Linux - Virtualization and CloudThis forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
We're using KVM on top of RedHat Enterprise and have been moving an image file (that contains a fully provisioned guest OS) from one machine to another. When we bring up the guest OS using virt-install with the --import feature, it works fine as long as the image file is on the fixed hard drive (essentially a typical /home directory mounted on /dev/sda). If we try to bring up the exact same guest OS using virt-install, but the image file is on a removable USB hard drive, we get the following error.
Starting install...
Guest installation complete... restarting guest.
ERROR internal error Process exited while reading console log output: qemu: could not open disk image /mnt/usb/virtual1b.img
Domain installation may not have been
successful. If it was, you can restart your domain
by running 'virsh start virtual1b'; otherwise, please
restart your installation.
ERROR internal error Process exited while reading console log output: qemu: could not open disk image /mnt/usb/virtual1b.img
Traceback (most recent call last):
File "/usr/sbin/virt-install", line 892, in ?
main()
File "/usr/sbin/virt-install", line 774, in main
dom.create()
File "/usr/lib64/python2.4/site-packages/libvirt.py", line 333, in create
if ret == -1: raise libvirtError ('virDomainCreate() failed', dom=self)
libvirtError: internal error Process exited while reading console log output: qemu: could not open disk image /mnt/usb/virtual1b.img
We have tried the following without success.
- It doesn't seem like an SELinux problem. No change if we change the security context of the image file (ours is called "virtual1b.img") on the USB drive. Also no change if we set SELinux to permissive. There's also nothing showing up in SELinux logs.
- It doesn't seem like a Linux file permission problem. All files belong to root and virt-install is run as root.
- It doesn't seem like a file corruption problem. The exact same image file boots up as a guest OS fine if copied onto the fixed hard drive.
Here's our setup (RHEL 5.6):
# uname -a
Linux localhost.localdomain 2.6.18-238.1.1.el5 #1 SMP Tue Jan 4 13:32:19 EST 2011 x86_64 x86_64 x86_64 GNU/Linux
Oh, do you mean if it was a typo or something? I mounted the usb drive at /mnt/usb and the name of the image file is "virtual1b.img".
I'm not sure if it matters, but the file is also big (like 50G big). I've tried this a bunch of times (with different files on different machines, with slightly different kernels) and the same error seems to come up.
I met a similar issue that cannot start a VM from NFS however it is OK from local disk. It seems since RHEL 5.6, by default the QEMU virtual machines will run as group/user of qemu/qemu who does not have enough permission to run VM image from some external devices. Please refer to http://libvirt.org/drvqemu.html for details. Configuring user=root and group=root in /etc/libvirt/qemu.conf could resolve it.
Both RHEL and ubuntu got similar issues reported and they provided the same solution. Please refer to following for details.
Thanks for the suggestion luckyfengyong and jefro. Darn, it didn't work. Same error message. (And unlike the postings that luckyfengyong referred to, I don't seem to have error messages that includ "Permission denied").
I logged the output from libvirtd (debug level), but it doesn't seem to helpful. Here's what seemed to be the relevant chunk:
19:20:01.452: debug : qemudShutdownVMDaemon:1684 : Shutting down VM 'virtual1b'
...
Nothing interesting in /var/log/messages either:
/var/log/messages
...
FAùúÀ' 16:21:38 localhost libvirtd: 16:21:38.458: error : Domain not found: no domain with matching name 'virtual1b'
Feb 20 16:21:38 localhost libvirtd: 16:21:38.483: error : Domain not found: no domain with matching name 'virtual1b'
Feb 20 16:21:38 localhost kernel: device vnet0 entered promiscuous mode
Feb 20 16:21:38 localhost kernel: br0: topology change detected, propagating
Feb 20 16:21:38 localhost kernel: br0: port 2(vnet0) entering forwarding state
Feb 20 16:21:38 localhost kernel: br0: port 2(vnet0) entering disabled state
Feb 20 16:21:38 localhost kernel: device vnet0 left promiscuous mode
Feb 20 16:21:38 localhost kernel: br0: port 2(vnet0) entering disabled state
Feb 20 16:22:08 localhost libvirtd: 16:22:08.943: error : internal error Timed out while reading console log output
Feb 20 16:22:08 localhost libvirtd: 16:22:08.943: error : internal error unable to start guest: qemu: could not open disk image /mnt/usb/virtual1b.img
...
In qemu.conf, I tried several setting syntaxes just in case it was quirky:
user = "root"
group = "root"
user=root
group=root
user ="root"
group="root"
user='root'
group='root'
Hmm. Any other suggestions would be appreciated! Thanks again.
Thanks jefro. I just finished trying something else.
It turns out that it works if the USB hard drive has an ext3 filesystem. I was using NTFS (using the fuse and fuse-ntfs-3g packages) as the filesystem. So it's possible that the problem is just with NTFS. Hmm, I'm going to try it reformatted to NTFS again (just in case something else changed that I didn't notice), and I'll run the command.
Ok I changed it back to an NTFS filesystem. Sure enough, it doesn't work, and the error appears again (same as above).
jefro, here's the output to ls:
# ls -l /mnt/usb
total 26214400
-rwxrwxrwx 1 root root 26843545600 Feb 22 08:54 virtual1b.img
Unless someone has another idea, I was going to try a primitive test and create an NTFS partition on my fixed hard drive. I'll try the same image file on there to see what happens (maybe narrow it down to just NTFS on a USB drive vs. NTFS in general?). Using a non-NTFS filesystem is probably a decent work-around, but part of all this is just to get a feel for how brittle KVM might be.
Oh, when the USB drive was formatted with an NTFS filesystem (which qemu could not seem to access), I mounted it just by:
mount /dev/sdc1 /mnt/usb
When I reformatted it with an ext3 filesystem, I mounted it the same way (and qemu could access it). Is there another approach to mounting the NTFS filesystem that I should try?
Open the newly creatted virtual machine and go to the "Hardware" tab. In Hardware tab remove your Hard disk and add a new storage disk which pointing to your image in your usb disk.
I came across the same issue like you. The above steps works fine for me. Even though it is not a direct solution.I hope this steps will solve your issue.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.