Sunday, April 27, 2014

KVM, virsh and virtual machine manager r0ck!

Just bought a sweet little 2x4 xeon server with vtx and 16GB of ECC RAM from ebay. First off you get what you pay for. It took me 5 hours of messing around to realize the bios switch setting for vtx was backwards. E.g. ON==OFF. Uggh The box in question is made by Rackable Systems and its got an Intel® Server Board S5000PSL. Its really a great machine but the bios is a little like...messed up. Anyway....if you are patient it all works great. My next task was to install Ubuntu and get some virtualization software up. I first started with my own copy of vmware 8, but turns out vmware8 workstation isn't supported well with ubuntu 14. So then I tried VirtualBox..which worked great. What I really wanted though was to run a couple of vms headless and after doing some research decided that KVM with the virsh tools was really the way to go for a quick win. I had a pre-built vmware image of free-pbx which I had used a couple years ago to run a VOIP phone system in the house. I decided that would be the first image I got running.

 1. Convert the image to a qemu compatible one qemu-img convert -p "CentOS 64-bit.vmdk" pbx.qcow2

2. Move the image to /var/lib/libvirt/images 

3. Install an entry for the new machine using the disk image you made sudo virt-install --import -n fee-pbx1 -r 2048 --disk path=/var/lib/libvirt/images/pbx.qcow2,bus=virtio --network network=default,model=virtio --graphics vnc,listen=0.0.0.0 --noautoconsole -v

 4. Make sure it autostarts when the host reboots virsh -c qemu:///system autostart fee-pbx1

After this I found a cool tool called Virtual Machine Manager which lets you ssh into the host machine and manager all your runnning images. This is on par with Vmware ESXi but it's free and really easy to install. You should ideally install virt-manager on your regular development workstation and remote into the vm host. I run centos on my dev box and virt-manager can be installed with yum.  Screenshots attached to highlight how sweet these tools are for a light user who wants persistent vms.

2 comments:

  1. Nice post you have apply VOIP phone system This is really very impressive and fast result as compare to other phone system.

    ReplyDelete
  2. That’s awesome! Congrats on purchasing a new xeon server. This should make your task a lot easier. I hope that would give you a reliable and efficient service for a long time. Also, thank you for sharing some technical input on how to set it up.

    Erick Brooks @ Ripple Web

    ReplyDelete