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 server1.test.com 
 107 46 running xx.xx.xx.xx server2.test.com 
 108 83 running xx.xx.xx.xx server3.test.com
 109 86 running xx.xx.xx.xx server4.test.com

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

# vzlist -a


# vzlist -a
 106 104 running xx.xx.xx.xx server1.test1.com 
 107 46 running xx.xx.xx.xx server2.test2.com 
 108 83 running xx.xx.xx.xx server3.test3.com
 109 86 running xx.xx.xx.xx server4.test4.com
 110 - stopped xx.xx.xx.xx server5.test5.com

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