- I first created a ‘template’ vm containing all stuff I need and using a temporarily ip adres.
- 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…
- Stop this ‘template’ vm as it is just used for cloning.
- Create a backup : vzdump –dumpdir /path/to/backupdir –snapshot 101
- 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
- Create a new mac for eth0 : vzctl set 102 –netif_add eth0
- Modify the hostname in the proxmox webinterface.
- Bootup the vm and open a vnc console.
- Change the ip address in /etc/sysconfig/network-scripts/ifcfg-eth0
- Go to /etc/ssh and remove all keys : rm -f /etc/ssh/*key*
- Restart the ssh server so it will regenerate keys : service sshd restart
Category Archives: OpenVZ
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 ext3 ext2 nodev rpc_pipefs nodev proc nodev nfs nodev sysfs nodev tmpfs nodev devpts
Proxmox VM path
Appliances and OS Templates
For PVE & OpenVZ templates-
PVE appliances-
Fix Date Time on PVE OpenVZ Guest machine
- Stop VE vzctl stop 101
- in HD node, run:
- vzctl set 101 –capability sys_time:on –save
- Start VE: vzctl start 101
- Enter VE: vzctl enter 101
- mv /etc/localtime /etc/localtime.old
- ln -s /usr/share/zoneinfo/Asia/Dhaka /etc/localtime
- date 092115442006 (09 = Month, 21 = day, 15 = hour, 44=minutes, 2006 = year)
Run date to check your time is right. That’s it!