|
||
Create a VM instructions
user@client1:~$ euca-describe-images user@client1:~$ dd if=/dev/zero of=CentOS-6-i386.img bs=1M count=1024 or you can use user@client1:~$ kvm-img create -f raw CentOS-6-i386.img 1G Formatting 'CentOS-6-i386.img', fmt=raw size=1073741824 user@client1:~$ Note: package 'qemu-kvm' must be installed. 'kvm-pxe' package may be needed too. Also VMX must be enabled from your computer bios. user@client1:~$ sudo kvm -m 512 -cdrom CentOS-6.0-i386-minimal.iso -drive file=CentOS-6-i386.img,if=scsi,index=0 -boot d -net nic -net user -nographic -vnc :0 vncviewer client1:0 sudo kvm -m 512 --drive file=CentOS-6-i386.img,if=scsi,index=0,boot=on -boot c -net nic -net user -nographic -vnc :0 Now install the software you would like to have on your vm. scp /boot/initramfs-2.6.32-71.el6.i686.img user@10.0.2.2:~/centos/ scp /boot/vmlinuz-2.6.32-71.el6.i686 user@10.0.2.2:~/centos/ Find out the starting block and the block size of the root file systems. To do so you can use parted: user@client1:~$ sudo parted CentOS-6-i386.img (parted) u Unit? [compact]? b then print the current partition table using 'p': note the start for the partition you are interested in and the size (for this example let's say start is 32256 and the size is 1024000); user@client1:~$ dd if=CentOS-6-i386.img of=CentOS-6-i386_rootfs.img bs=1 skip=32256 count=1024000NOTE: to speed up the process you can increase the block size, for exampe to 512: divide the size and the skip count by the new block size (512 in this case) and you get dd if=new.img of=rootfs.img bs=512 skip=63 count=2000 Sources |
||
|