Creating a Virtual Machine from an Existing one Manually
Back to: Xen on Debian
Assuming an LVM setup, this is the command for allocating the required disk space (in this example 20Gb) for the main disk of the virtual machine. Another amount is required for the swap space.
where machine-name and volumegroup-name are specific to the intended configuration.
The virtual units are formatted
After the file copy, it is necessary to edit some configuration files: securetty, inittab and fstab. First edit securetty
A line containing hvc0 should be in the file.
#... # IBM iSeries/pSeries virtual console hvc0 hvc1 #...
Then search inittab for a line with tty like the one below:
#c1:12345:respawn:/sbin/agetty 38400 tty1 linux
and edit it to:
c1:12345:respawn:/sbin/agetty 38400 hvc0 linux
Next, edit fstab to reflect the virtual drive configuration
/dev/xvda1 / ext3 defaults 1 1 /dev/xvda4 swap swap defaults 0 0 tmpfs /dev/shm tmpfs defaults 0 0 devpts /dev/pts devpts gid=5,mode=620 0 0 sysfs /sys sysfs defaults 0 0 proc /proc proc defaults 0 0
It is important that in the moment the files were copied, the directories /proc and /dev had been left out. Now it is important to create those directories. First mount the partition:
Then create the directories:
And then create the devices for the virtual machines