Jump to content
Sign in to follow this  
mossiemosforth

Getting started with KVM & VM Manager plugin

9 posts in this topic Last Reply

Recommended Posts

Good evening guys. I've been loitering in the background for quite some time lately, here's where i got to the last time i got into playing with my unraid box.

 

I started off with the initial 6 betas and successfully got as far as 5a without a hitch. beta 6 broke the xen nic drivers so i reverted to 5a. I have a win7 vm with 2nics passthough'd to provide internet access to the house via my phone's hotspot (landlines are rubbish here), an ubuntu vm running sickbeard/sab/couchpotato/shared xbmc db and a kali linux vm to play with. All has been good and well (still is if i'm honest) but i'm now in need of more rapid creation/deletion of vms for testing purposes so i've come back to pay the forum another good look into and i must say i'm impressed with the route the product is going.

 

seems like a prime move would be to go toward kvm rather than xen. i've just updated to beta10a tonight and was hoping to have a look at the VM Manager plugin, but after installing it i don't get the VM tab, am i missing something?

 

2nd to that is there an easy method to creating kvm vms and reusing the .img i have for my current vms? or am i looking at building from scratch?

 

also docker is now on the cards for me and i replace my ubuntu vm with a few containers, how would i go about accessing the containers to import my configs for each app? sorry docker is a complete new concept to me, in principle it seems similar to zones ive used in solaris before, if that makes sense? I probably should mention i have my vms on a btrfs ssd mounted outside the array, so can easily install it there before someone mentions that.

 

Any advice would be greatly appreciated, thanks in advance :D

Share this post


Link to post

To run VM Manager:

 

Install the VM manager plugin:

https://raw.githubusercontent.com/dmacias72/vmMan/master/vmMan.plg

Then install the Virtman Libvirt plugin:

https://raw.githubusercontent.com/dmacias72/virtMan/master/virtMan.plg

Then go to the Settings tab and start the virtMan setting.

 

What format are your images in?  I know KVM works best with .qcow2 image files.  If it's not qcow2, you can probably convert it to qcow2. I did that from a VirtualBox .vdi image.

 

For the containers, you set your "config" directory.  Just locate that on the host and copy your config files into there.  I've never done it, but I don't see why it wouldn't work as long as your permissions are set correctly.

 

Share this post


Link to post

thanks so much for that, it was literally just starting the Virtman plugin, i feel a little daft now  :o

 

had a quick look at the vm manager and wow, far nicer than writing xen cfg files :D

sadly my images are in raw .img format, pretty sure you can convert them but i'll have to look into that.

 

as for the containers, i think i know what you mean. my ssd is mounted outside the array at /mnt/vertex and i've installed docker there.

from the share i can see the docker (containers under that)directory but no access from windows, i'll have to play around with permissions once i have a container or 2 installed, or failing that just do everything via ssh.

 

at least now i have a starting point, can't thank you enough for pointing that out ;)

Share this post


Link to post

http://www.agix.com.au/blog/?p=2696

 

qemu-img convert -f raw -O qcow2 /home/libvirt/images/vmguest1.img /home/libvirt/images/vmguest1.qcow2

 

I'd probably make a copy of the .img file and then convert that guy.  Realistically, it's copying your img to a new file anyway and the original img file should be untouched, but better safe than sorry.

Share this post


Link to post

thanks for that, may give that a try shortly.

had a little play just now and my windows 10 trial vm fired up in kvm without a hitch, just set the image type to raw and it booted fine. Gave it a shot with my win7 vm and BSOD straight away :(

i'll copy the image file and convert it now, see if thats any better. failing all else i'll just have to take my configs off it in xen, then rebuild a new one in kvm or perhaps build the new one first and trial it out before i kill the old one.

if i have to rebuild it's to happen tonight anyway, need to switch back to xen soon so i can watch the new xmen movie in bed :D

 

thanks again ;)

 

Share this post


Link to post

thanks for that, may give that a try shortly.

had a little play just now and my windows 10 trial vm fired up in kvm without a hitch, just set the image type to raw and it booted fine. Gave it a shot with my win7 vm and BSOD straight away :(

i'll copy the image file and convert it now, see if thats any better. failing all else i'll just have to take my configs off it in xen, then rebuild a new one in kvm or perhaps build the new one first and trial it out before i kill the old one.

if i have to rebuild it's to happen tonight anyway, need to switch back to xen soon so i can watch the new xmen movie in bed :D

 

thanks again ;)

You might try running a copy of your vm in xen first and installing the virtio drivers for windows. Then convert it and try it in kvm

http://alt.fedoraproject.org/pub/alt/virtio-win/latest/images/

 

Share this post


Link to post

I've used both dockers and vm's and prefer my ubuntu server vm for my apps.  If you can easily setup the apps you want in a ubuntu install then I'd stick with that.  With kvm you can also setup 9p file sharing in linux vm's (although there's some debate on the speed right now). You can share unRAID directories directly in the vm.  No need for network cifs shares.

 

If you want to use dockers you just have to point each individual docker's config to say /mnt/CacheOrNonArrayDisk/appdata/DockerAppName. Then you can copy your existing configs there after you've created and started them stopped them.

Share this post


Link to post

sorry for the late reply guys, been away in italy for the last week with work, appeciate your replies.

while i've been away my vm setup has decided to have a spectacular crash and now my windows vm won't even boot! i'm ok with it as tbh there were no configs i really needed to salvage anyway, the wife and kids were not too happy as the ubuntu vm (which i have salvaged luckily) holding my shared xbmc library also died and they couldn't watch anything on the raspberry pi's :(

 

today i've managed to get a nice little windows 10 vm up and running fine using the VM Manager, very impressed with its ease of use once you have the hang of it. i went straight with qcow2 format images and after realising you need the virtio drivers i was well away. but thats where the ease disappears.

 

Previously i had 2 pci nic cards passed through to the windows 7 vm which i used ics on to provide a bridge between my smartphone and the routers wan port (broadband speeds are rubbish in my area, and till the end of january i have unlimited tethering, they are cutting me off then)

 

i have located the devices section and happily identified my 2 nics, but when i copy the xml config for the device into the vm's xml (using the VM Manager gui) they don't seem to save. are you able to edit the xml from the gui? or where in the file system can i find the xml file so i can edit it manually?

 

thanks in advance ;)

Share this post


Link to post

Just had another thought, do i need to add any lines to my syslinux cfg like i had to with xen. in order to hide the pci devices from the host that is?

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this