If you have to create a xen virtual domain use this command:
xen-create-image –hostname=DOMAINNAME –size=2Gb –swap=256Mb –ide –ip=IPADDRESS –netmask=255.255.255.192 –gateway=IP_ADDRESS_HOST_SYSTEM –dir=/xen –memory=1024M –kernel=/boot/vmlinuz-2.6.26-2-xen-amd64 –initrd=/boot/initrd.img-2.6.26-2-xen-amd64 –debootstrap –dist=lenny –mirror=http://ftp2.de.debian.org/debian/ –passwd
in the DOMAINNAME.cfg please enter :
extra = “console=hvc0 xencons=tty”
to be able to login trough
xm console DOMAINNAME.cfg
Shutdown of the DOMAIN is used by xm destroy DOMAINNAME
Create is done by xm create DOMAINNAME.cfg
apt-get install udev after you have logged in
Ok, I am using Xen to create a domain (virtual machine). Now i want to resize the virtual disk image, because 2GB are not enough ?
The solution is easy :
First go to the place where my virtual disks are
cd /xen/images/DOMAINNAME/
Now i use the command dd to create a 10 GB file
dd if=/dev/zero of=10gbfile bs=1024 count=10000000
And first shutdown the guest system with xm shutdown DOMAINNAME.cfg
Now append the 10gbfile to the virtual image file
cat 10gbfile >> disk1.img
Now you have to fix the resized big file disk1.img with :
resize2fs -f disk1.img
done.
Now you have 10GB more on your disk1.img