Convert .ova and import it on Proxmox KVM virtualization

Let’s start uploading the exported ova file to the proxmox server. Extract the OVA file:

tar -xvf *.ova

This should output a couple of files from the OVA container, it should include an OVF file, which is the VM Defenition file, and a VMDK file, which is the actual hard disk image. Again, this may take a while.

Convert the vmdk to a Proxmox compatible qcow2 file:

qemu-img convert -f vmdk myvirtual-disk1.vmdk  -O qcow2 qcowdisk.qcow2

We now need to get the image into a VM with some hardware so that we can begin to use it. This is where things get tricky – the OVF file is not compatible with Proxmox and needs to be manually understood. The principle here is we are going to use the Proxmox web GUI to create a VM and replace the empty disk image which is created with our recently converted qcow2 image.

You can use vi to open the OVF file and understand some of the basic settings which are required for the VM. Open the OVF file and look for the following XML tags:

  • OperatingSystemSection
  • VirtualHardwareSection
  • Network
  • StorageControllers

Continue reading “Convert .ova and import it on Proxmox KVM virtualization” »


Fix on connecting to NFS server from Proxmox Centos 7 Container

I hope you already know how to allow NFS from proxmox host server. if not, you may read my earlier post:

NFS fix on LXC Host Server

I was actually receiving a error like below:

# mount -t nfsd nfsd /proc/fs/nfsd
mount: nfsd is write-protected, mounting read-only
mount: cannot mount nfsd read-only

My proxmox edition was 5.0-30 and my CentOS was 7.

However, this is a bit different rather looking the other one as mentioned above. I was experiencing connecting my Centos 7 LXC container to a NFS server in the network. The regular tweak didn’t work. So, had to spend a while googling the solution. Found the correct one on a forum thread. But eventually it worked. For this you need to edit the file

nano /etc/pve/lxc/<your container ID>.conf

Add the below line in the conf file:

lxc.aa_profile: unconfined

Reboot the container. And now try to connect the NFS server. It should work.



Enable VNC viewer for Proxmox 2.x/3.x with tightvnc

Configure Proxmox host for TLS connections: This configures the host to accept VNC connections.

aptitude install openbsd-inetd

Run this to get your KVM id’s :

qm list
root@homenet-home10 /etc # qm list
101 freenas stopped 1024 32.00 0 
102 debpbx running 512 0.00 573304 
105 winxp stopped 512 15.01 0 
7012 ltsp-ldap-openfire-KVM running 512 9.00 495870 
7016 fbc16-kvm running 512 8.00 462697 
7159 win7 stopped 2048 0.00 0 
27014 ltsp-term-KVM stopped 512 0.00 0

edit /etc/inetd.conf , put a port for each kvm you want to access using kvm

#port kvm
59055 stream tcp nowait root /usr/sbin/qm qm vncproxy 105
59058 stream tcp nowait root /usr/sbin/qm qm vncproxy 7159

restart openbsd-inetd Continue reading “Enable VNC viewer for Proxmox 2.x/3.x with tightvnc” »


Essential Openvz commands

1. Command to list the running VPSs in a node

# vzlist


# vzlist
 106 104 running xx.xx.xx.xx 
 107 46 running xx.xx.xx.xx 
 108 83 running xx.xx.xx.xx
 109 86 running xx.xx.xx.xx

2. This command lists all (running and stopped) the VPSs in a node.

# vzlist -a


# vzlist -a
 106 104 running xx.xx.xx.xx 
 107 46 running xx.xx.xx.xx 
 108 83 running xx.xx.xx.xx
 109 86 running xx.xx.xx.xx
 110 - stopped xx.xx.xx.xx

Continue reading “Essential Openvz commands” »


NFS fix on LXC Host Server

NFS client on LXC seems do not work. Why? The problem is apparmor on the real machine that block any appempt to mount NFS volumes.
In order to try to minimize the security changes on apparmor I add the following lines in/etc/apparmor.d/lxc/lxc-default

# allow nfs mount everywhere

mount fstype=rpc_pipefs, 
mount fstype=nfs,


$ /etc/init.d/apparmor reload

And now I was able to restart nfs-common and nfs-kernel-server without errors !


nano /etc/apparmor.d/lxc/lxc-default

Update the file as below-

# Do not load this file. Rather, load /etc/apparmor.d/lxc-containers, which
# will source all profiles under /etc/apparmor.d/lxc

profile lxc-container-default flags=(attach_disconnected,mediate_deleted) {
#include <abstractions/lxc/container-base>

# the container may never be allowed to mount devpts. If it does, it
# will remount the host's devpts. We could allow it to do it with
# the newinstance option (but, right now, we don't).
# deny mount fstype=devpts,

# allow nfs mount everywhere

mount fstype=rpc_pipefs,
mount fstype=nfs,

Cloning Openvz Proxmox PVE container guest machine

  1. I first created a ‘template’ vm containing all stuff I need and using a temporarily ip adres.
  2. In the network config file of eth0 (/etc/sysconfig/network-scripts/ifcfg-eth0) I comment out the HWADDRESS line, else it will not come up with another mac address…
  3. Stop this ‘template’ vm as it is just used for cloning.
  4. Create a backup : vzdump –dumpdir /path/to/backupdir –snapshot 101
  5. Restore in new container : vzrestore /path/to/backupdir/backupfile_of_container_101 102 or vzrestore –storage ‘storagename’ /path/to/backupdir/backupfile_of_container_101 102
  6. Create a new mac for eth0 : vzctl set 102 –netif_add eth0
  7. Modify the hostname in the proxmox webinterface.
  8. Bootup the vm and open a vnc console.
  9. Change the ip address in /etc/sysconfig/network-scripts/ifcfg-eth0
  10. Go to /etc/ssh and remove all keys : rm -f /etc/ssh/*key*
  11. Restart the ssh server so it will regenerate keys : service sshd restart

Allow NFS attachment on Proxmox OpenVZ containers

Prepare the container

To allow a container to use NFS filesystem, you will need to start it with “nfs” feature enabled. If the container is running while you set the –features nfs:on, you will need to reboot it.

# vzctl set 101 --features "nfs:on" --save
# vzctl start 101

After this you may see nfs in /proc/filesystems

# vzctl exec 101 cat /proc/filesystems
nodev rpc_pipefs
nodev proc
nodev nfs
nodev sysfs
nodev tmpfs
nodev devpts