saarg Posted November 18, 2014 Share Posted November 18, 2014 I found out what was causing my VM's not to autostart It was the tag for VNC! I had this in my xml file: <graphics type='vnc' port='5901' autoport='no' listen='192.168.1.5'> <listen type='address' address='192.168.1.5'/> </graphics> After changing it to this, everything works: <graphics type='vnc' port='5901' autoport='yes' websocket='5701' listen='0.0.0.0' keymap='no'> <listen type='address' address='0.0.0.0'/> </graphics> The only problem I have now is that I have to reboot unraid a couple of times before the DVB card is correctly passed through to my VM. It might have something to do with vfio-bind is run in the go file a while after libvirt is started. Quote Link to comment
dmacias Posted November 18, 2014 Author Share Posted November 18, 2014 I found out what was causing my VM's not to autostart It was the tag for VNC! I had this in my xml file: <graphics type='vnc' port='5901' autoport='no' listen='192.168.1.5'> <listen type='address' address='192.168.1.5'/> </graphics> After changing it to this, everything works: <graphics type='vnc' port='5901' autoport='yes' websocket='5701' listen='0.0.0.0' keymap='no'> <listen type='address' address='0.0.0.0'/> </graphics> The only problem I have now is that I have to reboot unraid a couple of times before the DVB card is correctly passed through to my VM. It might have something to do with vfio-bind is run in the go file a while after libvirt is started. That's good to know. I wasnt sure what else to try. If using autoport "yes" you may want to change the ports to -1. Unless you want a specific port assigned. Quote Link to comment
dmacias Posted November 18, 2014 Author Share Posted November 18, 2014 Would this let me run a VM from an SSD outside the array without mounting it using SNAP? I installed SNAP, and that seems to be working fine, but if I can eliminate another plugin, and do it directly, that might be a better option. If so, do i need to do anything other than add this code to my XML? is anything done in the go file, for example? thanks Yes, but it gives block level access to the SSD, so there's no qcow2 file or anything. So when I installed Windows 8.1, it created the NTFS file system on the actual SSD, instead of within an image file. I found this to have excellent performance just from my initial messing around (no tests run yet). The "source" should be pointed to your individual drive at /dev/disk/by-id folder instead of a /dev/sdx or whatever, because the sdx might change upon reboots. You'll also want to add to the <os> </os> section: <os> <boot dev='cdrom'/> <bootmenu enable='yes' timeout='3000'/>' </os> This seems necessary in order to be able to boot from an iso to do the initial install. The boot dev is set to cdrom for the created/first time running xml. However the cdrom is removed and boot dev set to hd for the persistent xml. The drivers cdrom is not removed. So for vm's set yes as persistent when created there are 2 xml's created. One for first run and then the persistent xml. If set to no there will just be the running xml. I plan to add something for non-array disks. I have a mythbuntu vm with a non-array drive added for tv recording. The template page could use some more things. Maybe lose some Thanks for the iso bug. I thought I had checked for that. I will add a check for caps too. @Justin. You don't need to add anything to the go file just the diskbyid info to your xml. I found snap was a little more than I needed. I have a simple plugin I created that just loads my vm drive. Quote Link to comment
JustinChase Posted November 18, 2014 Share Posted November 18, 2014 Would this let me run a VM from an SSD outside the array without mounting it using SNAP? Yes, but it gives block level access to the SSD, so there's no qcow2 file or anything. So when I installed Windows 8.1, it created the NTFS file system on the actual SSD, instead of within an image file. Since I already have the qcow2 image working fine, I'll not bother with trying to change this now. I don't want to install everything again @Justin. You don't need to add anything to the go file just the diskbyid info to your xml. I found snap was a little more than I needed. I have a simple plugin I created that just loads my vm drive. If something gets added to this plugin, to allow mounting the drive outside the array, like SNAP, but without SNAP plugin, I'd definitely use it Thanks again. Quote Link to comment
saarg Posted November 18, 2014 Share Posted November 18, 2014 That's good to know. I wasnt sure what else to try. If using autoport "yes" you may want to change the ports to -1. Unless you want a specific port assigned. It's set to -1, it's just that I copied it from a running VM and then the port is set in the xml file. Quote Link to comment
reluctantflux Posted November 18, 2014 Share Posted November 18, 2014 Quick question, does the vcpu drop down know how many vcpu's my machine has total, or just defaults to 16? I have an i7 4790, and figured I have only 8 vcpu's (hyperthreaded quadcore). Just curious if I have more virtual cores than I thought I did. Thanks. Quote Link to comment
dmacias Posted November 18, 2014 Author Share Posted November 18, 2014 Quick question, does the vcpu drop down know how many vcpu's my machine has total, or just defaults to 16? I have an i7 4790, and figured I have only 8 vcpu's (hyperthreaded quadcore). Just curious if I have more virtual cores than I thought I did. Thanks. No, 16 is the hard coded limit for kvm. I may look at that and see if I can base it off the system. The ram is based on system ram. I have 8 cores but no hyper threading. Quote Link to comment
ffingers Posted November 19, 2014 Share Posted November 19, 2014 I hoped I don't get flamed...REALLY new to KVM. Installed the VM manager and virtman....but from there...stumped. Tried to create a VM but don't have any idea where to start. I have both a Windows 7 qcow2 from a Xen VM I was running before as well as a desktop Ubuntu ISO I want to run. Don't care much about the win 7 at the moment (next) but would like to get the desktop Ubuntu up and running. Anyone point me to a step by step using the VM manager to do so. I understand a LITTLE bit about the XML stuff but can't figure out how it works (auto generated) or what. Any help please Thanks Tony I assume you were running xen so you have a network bridge setup in unRAID. Next you need to create a storage pool or pools (the green plus under storage) pointing to the location of your iso and/or where you want to store your vm images. I have a pool for iso's and a pool for vm images. If on the cache drive make sure it's cache only. It can be an existing directory or a new one. Once the pool is created you can create an image in the pool by clicking on the green plus under pool actions. For ubuntu I would create a 10G qcow2 image. Next go to CREATE and select your iso image for install image and PAE for 32bit or not, amount of memory, number of vcpus, and select your unbuntu.qcow2 for disk image then click create vm. Should create and auto start the vm. From the main VM's page or the domain info page click on the eye to open a vnc connection to your new vm. I think that's everything. For ubuntu you can also setup 9p sharing which allows you to mount an unRAID share point inside your vm. I just share /mnt. Thanks so much dmacias....got it up and running with a few stumbles (me being a linux virgin mostly)... quick question...how hard/is it possible to expand the qcow2 image? I did 10GB and did a desktop ubuntu install mainly to try it out and play...and installed an LAMP stack on it so i could do some internal dev....unfortunately i don't have much space left...only like 2.5 GB (had no idea ubuntu desktop needed so much)...is it possible to expand it so i have a little more space to do dev stuff? thanks again!! plugin is awesome! Tony Quote Link to comment
reluctantflux Posted November 19, 2014 Share Posted November 19, 2014 From command line: qemu-img resize IMAGE.qcow2 +15GB Found here. You'll then have to expand the disk from the OS side, as well, since the additional space will be considered "unallocated". Quote Link to comment
itimpi Posted November 19, 2014 Share Posted November 19, 2014 Is there any way to insert comments via the option to edit a VM's XML and have them remain. They seem to get stripped out when I press Save. It would be nice to have them preserved as I would like to comment the XML with information about the decisions I made. Quote Link to comment
dmacias Posted November 19, 2014 Author Share Posted November 19, 2014 Is there any way to insert comments via the option to edit a VM's XML and have them remain. They seem to get stripped out when I press Save. It would be nice to have them preserved as I would like to comment the XML with information about the decisions I made. I don't think so. Libvirt will strip them out. You can enter a <description> </description> or you could try <metadata> but you might need a custom name space like qemu commandline does. Quote Link to comment
peter_sm Posted November 19, 2014 Share Posted November 19, 2014 Quick question, does the vcpu drop down know how many vcpu's my machine has total, or just defaults to 16? I have an i7 4790, and figured I have only 8 vcpu's (hyperthreaded quadcore). Just curious if I have more virtual cores than I thought I did. Thanks. No, 16 is the hard coded limit for kvm. I may look at that and see if I can base it off the system. The ram is based on system ram. I have 8 cores but no hyper threading. try these command virsh nodeinfo virsh nodecpumap Quote Link to comment
ffingers Posted November 20, 2014 Share Posted November 20, 2014 From command line: qemu-img resize IMAGE.qcow2 +15GB Found here. You'll then have to expand the disk from the OS side, as well, since the additional space will be considered "unallocated". thanks reluctant...i saw that but was unsure if it would work and didn't want to run a command and have it bork the whole install...appreciate the confirmation! thanks for all the support and hard work guys...appreciate it! Quote Link to comment
archedraft Posted November 20, 2014 Share Posted November 20, 2014 My server froze due to me messing around ... Now something is messed up with KVM. When I try I create a VM i get this message : Error adding domain definition: cannot write data to file '/etc/libvirt/qemu/windows8.xml.new': No space left on device and if I try and edit an existing XML it says no space left and complete deletes the XML file. My SSD that houses the VM's still has 45GB of free space. What is going on? Is my virtMan.img corrupt? My syslog gives me this error at the same time: Nov 19 22:22:13 Pithos kernel: EXT4-fs (loop0): error count since last fsck: 5 Nov 19 22:22:13 Pithos kernel: EXT4-fs (loop0): initial error at time 1416456245: mb_free_blocks:1450: inode 21: block 1196 Nov 19 22:22:13 Pithos kernel: EXT4-fs (loop0): last error at time 1416457094: ext4_mb_generate_buddy:757 Quote Link to comment
dmacias Posted November 20, 2014 Author Share Posted November 20, 2014 My server froze due to me messing around ... Now something is messed up with KVM. When I try I create a VM i get this message : Error adding domain definition: cannot write data to file '/etc/libvirt/qemu/windows8.xml.new': No space left on device and if I try and edit an existing XML it says no space left and complete deletes the XML file. My SSD that houses the VM's still has 45GB of free space. What is going on? Is my virtMan.img corrupt? My syslog gives me this error at the same time: Nov 19 22:22:13 Pithos kernel: EXT4-fs (loop0): error count since last fsck: 5 Nov 19 22:22:13 Pithos kernel: EXT4-fs (loop0): initial error at time 1416456245: mb_free_blocks:1450: inode 21: block 1196 Nov 19 22:22:13 Pithos kernel: EXT4-fs (loop0): last error at time 1416457094: ext4_mb_generate_buddy:757 run fsck.ext4 /boot/config/plugins/virtMan/virtMan.img if you can't fix it, you can copy/backup your libvirt files from /etc/libvirt then uninstall virtMan plugin and remove /boot/config/plugins/virtMan directory then reinstall virtMan plugin and copy your files back to /etc/libvirt and restart libvirt. Quote Link to comment
luca2 Posted November 20, 2014 Share Posted November 20, 2014 Archedraft....try to add start from your hdd and not only from tour cdrom . Quote Link to comment
archedraft Posted November 20, 2014 Share Posted November 20, 2014 run fsck.ext4 /boot/config/plugins/virtMan/virtMan.img if you can't fix it, you can copy/backup your libvirt files from /etc/libvirt then uninstall virtMan plugin and remove /boot/config/plugins/virtMan directory then reinstall virtMan plugin and copy your files back to /etc/libvirt and restart libvirt. Running fsck.ext4 /boot/config/plugins/virtMan/virtMan.img did not fix the issue. I had to completely wipe virtMan. Now everything is back to normal. It really sucks when your server gets locked up and requires a hard reboot. Thanks dmacias for your assistance. Quote Link to comment
archedraft Posted November 20, 2014 Share Posted November 20, 2014 Does "snapshot" just save the XML config settings file or does it save a backup of the VM's qcow2 so that if something goes wrong you can revert back? Quote Link to comment
dmacias Posted November 20, 2014 Author Share Posted November 20, 2014 Does "snapshot" just save the XML config settings file or does it save a backup of the VM's qcow2 so that if something goes wrong you can revert back? It doesn't save the xml. If running it will save memory state like hibernation and create a filesystem checkpoint and save all that within the qcow2 file. If stopped it will save the state before boot. So if you start your vm and create a snapshot then create a text file and shutdown. If you revert, the vm will return to that memory state and the file will be gone. Quote Link to comment
johnodon Posted November 21, 2014 Share Posted November 21, 2014 Can we have the ability to add comments for each snapshot...just a small text box? Quote Link to comment
dmacias Posted November 22, 2014 Author Share Posted November 22, 2014 Can we have the ability to add comments for each snapshot...just a small text box? I can probably do that with a metadata node in the vm's xml file. Quote Link to comment
luca2 Posted November 22, 2014 Share Posted November 22, 2014 How do actually backup your vm´s? Just stop vm and copy qcow2 to array and I have backups of the virtMan.img too Hi dmacias, Where is actually stored virtMan.img? /usr/local/emhttp/plugins/vmMan Quote Link to comment
luca2 Posted November 22, 2014 Share Posted November 22, 2014 How do actually backup your vm´s? Just stop vm and copy qcow2 to array and I have backups of the virtMan.img too Hi dmacias, I am not sure where is actually stored virtMan.img? I have the same file in the following places: root@Tower:/usr/local/emhttp/plugins/virtMan/virtMan# ls virtMan.cfg virtMan.img root@Tower:/boot/config/plugins/virtMan# ls virtMan-2014.09.30a.tar.gz* virtMan.cfg* virtMan.img* Which one should I backup? Rgds. Quote Link to comment
dmacias Posted November 22, 2014 Author Share Posted November 22, 2014 How do actually backup your vm´s? Just stop vm and copy qcow2 to array and I have backups of the virtMan.img too Hi dmacias, I am not sure where is actually stored virtMan.img? I have the same file in the following places: root@Tower:/usr/local/emhttp/plugins/virtMan/virtMan# ls virtMan.cfg virtMan.img root@Tower:/boot/config/plugins/virtMan# ls virtMan-2014.09.30a.tar.gz* virtMan.cfg* virtMan.img* Which one should I backup? Rgds. The one in /boot/config/plugins/virtMan is the one you should backup. The other in emhttp is the default version that comes with the plugin and gets copied to your flash if virtMan.img doesn't exist. Quote Link to comment
luca2 Posted November 23, 2014 Share Posted November 23, 2014 Hi dmacias, Thx for quick replay. I am trying to do a snapshot a my vm´s. But after pressing the "snapshot" button nothing happens. Maybe this has to do with my vm´s .qcow2 being saved in an SSD outside of the array (mounted in /mnt/vm/w8)? I hope you can help me with this too. Let me know if you need any other info from me. Rgds. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.