LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Password
Linux - Virtualization and Cloud This 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


Reply
  Search this Thread
Old 05-05-2019, 03:20 PM   #1
DItatorebianco
LQ Newbie
 
Registered: May 2019
Posts: 4

Rep: Reputation: Disabled
How do you transfer VM to USB? Cloning and XAPI haven't worked.


Hi everyone.

I realise it's probably a total rookie mistake but I've been trying to transfer a virtual machine to a USB for the last two weeks with no success.

I tried

1. cloning it to a 58 gig usb stick with virt-manager and I got the following error-


Error creating virtual machine clone 'debian9-clone': Couldn't create storage volume 'debian9-clone.qcow2': 'internal error: Child process (/usr/bin/qemu-img convert -f qcow2 -O qcow2 -o compat=1.1,lazy_refcounts /var/lib/libvirt/images/debian9.qcow2 '/run/media/Username/STORE N GO/debian9-clone.qcow2') unexpected exit status 1: qemu-img: error while writing sector 9840896: File too large
qemu-img: Failed to flush the refcount block cache: File too large
'

Traceback (most recent call last):
File "/usr/share/virt-manager/virtinst/storage.py", line 747, in install
vol = self.pool.createXMLFrom(xml, self.input_vol, cloneflags)
File "/usr/lib64/python3.7/site-packages/libvirt.py", line 3240, in createXMLFrom
if ret is None:raise libvirtError('virStorageVolCreateXMLFrom() failed', pool=self)
libvirt.libvirtError: internal error: Child process (/usr/bin/qemu-img convert -f qcow2 -O qcow2 -o compat=1.1,lazy_refcounts /var/lib/libvirt/images/debian9.qcow2 '/run/media/Username/STORE N GO/debian9-clone.qcow2') unexpected exit status 1: qemu-img: error while writing sector 9840896: File too large
qemu-img: Failed to flush the refcount block cache: File too large


During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/share/virt-manager/virtManager/asyncjob.py", line 75, in cb_wrapper
callback(asyncjob, *args, **kwargs)
File "/usr/share/virt-manager/virtManager/clone.py", line 855, in _async_clone
self.clone_design.start_duplicate(meter)
File "/usr/share/virt-manager/virtinst/cloner.py", line 457, in start_duplicate
dst_dev.build_storage(meter)
File "/usr/share/virt-manager/virtinst/devices/disk.py", line 811, in build_storage
vol_object = self._storage_backend.create(meter)
File "/usr/share/virt-manager/virtinst/diskbackend.py", line 642, in create
return self._vol_install.install(meter=progresscb)
File "/usr/share/virt-manager/virtinst/storage.py", line 761, in install
"'%s': '%s'" % (self.name, str(e)))
RuntimeError: Couldn't create storage volume 'debian9-clone.qcow2': 'internal error: Child process (/usr/bin/qemu-img convert -f qcow2 -O qcow2 -o compat=1.1,lazy_refcounts /var/lib/libvirt/images/debian9.qcow2 '/run/media/Username/STORE N GO/debian9-clone.qcow2') unexpected exit status 1: qemu-img: error while writing sector 9840896: File too large
qemu-img: Failed to flush the refcount block cache: File too large

2. I also put the following commands into terminal-
fdisk -l
mkdir /mnt/usb
mount /dev/sdb1 /mnt/usb
xl vm-export vm=debian9.qcow2 filename=debian9.xva

The output was-
xencall: error: Could not obtain handle on privileged command interface: No such file or directory
libxl: error: libxl.c:102:libxl_ctx_alloc: cannot open libxc handle: No such file or directory
cannot init xl context

There's a bounty of a thousand pieces of liquorice for anyone who can help
 
Old 05-06-2019, 06:37 AM   #2
dc.901
Senior Member
 
Registered: Aug 2018
Location: Atlanta, GA - USA
Distribution: CentOS/RHEL, openSuSE/SLES, Ubuntu
Posts: 1,005

Rep: Reputation: 370Reputation: 370Reputation: 370Reputation: 370
Maybe I am not understanding here; perhaps my Tea hasn't kicked in yet this morning?
Why not simply copy the vmdk or vhd file to the usb?
 
1 members found this post helpful.
Old 05-06-2019, 11:29 AM   #3
dan.mera
LQ Newbie
 
Registered: Feb 2009
Posts: 21

Rep: Reputation: 9
as dc.901 said not sure what you want to accomplish. you want to install the copy of the vm on another machine where you one to use it? or your intent is to clone it and then use it as a usb to boot it on another computer. That as far as I know is not possible. so not sure which Virtual Manager tool are you using but to use the same vm on 2 different machines it will have to be the same tool. export the vm on the machine you are working on and import it on the machine you want to use it. The tool will handle everything needed. but to create a bootable usb disk from a vm you will need something else but for sure not clone. There are ways to create a bootable disk but you'll have to find out how to do that. good luck!
 
1 members found this post helpful.
Old 05-06-2019, 11:39 AM   #4
DItatorebianco
LQ Newbie
 
Registered: May 2019
Posts: 4

Original Poster
Rep: Reputation: Disabled
I gave that a shot but the path wasn't recognised when I tried to use it again and even if I copied the file back to the original directory it wouldn't recognise it. The only way to change the path was through cloning it and that didn't work either.

Yeh I was hoping to boot it from a USB. I'd read posts where people said they had done it.
Does that mean the only option would be to create a bootable version of, say fedora, and use fedora live like a VM?
 
Old 05-07-2019, 10:19 AM   #5
dan.mera
LQ Newbie
 
Registered: Feb 2009
Posts: 21

Rep: Reputation: 9
still trying to understand what you want to achieve. to have a linux flavor(ex. fedora) running from usb? or to install fedora on a VM? for first option there are flavors which are usb bootable(ex. openSUSE). to install it ona vm you have to use your vmware or any other tool to do it. i cannot help unless you clarify things and i'm sure others are in the same situation and cannot read your mind for what you want to do.
 
Old 05-07-2019, 11:23 AM   #6
DItatorebianco
LQ Newbie
 
Registered: May 2019
Posts: 4

Original Poster
Rep: Reputation: Disabled
I don't know if this is clearer but currently my VM is stored at /var/lib/libvirt/images/ but I want it to be stored at /run/media/Username/STORE N GO.
The idea is to keep the data stored on the USB drive separate from the host machine as well as allowing me to use it across multiple machines.
Don't know if that's any clearer but I do appreciate you guys patience.
 
Old 05-08-2019, 07:49 AM   #7
dan.mera
LQ Newbie
 
Registered: Feb 2009
Posts: 21

Rep: Reputation: 9
so what i understand now is that you want a place to save some data which can be used by either the host or the VM/VM's which you are running on your machine. you would like to be on the usb. well an usb is mounted when you insert it in and there are settings to allow it to be mounted on the VM machine also. if the host is Windows and the VM is linux it might a bit trickier as the files system type should be the one the windows wants(NTFS or FAT). you don't need the entire os to be saved on the usb only the data to be interchangeably used on multiple machines (including hosts or vm's).
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to install "XAPI" on fedora? hack3rcon Fedora 5 06-07-2016 08:25 AM
Slackware 14.1, full install, sound card worked OK, but microphone is not worked. zw963 Slackware 7 11-23-2013 06:57 AM
/etc/network/interfaces - Debian7 + XCP-Xapi stomach Linux - Server 1 11-02-2013 10:40 AM
yum haven't worked properly rishad Linux - Newbie 5 07-10-2012 03:25 AM
wine troubles (last few versions haven't worked for me) calimer Linux - Software 2 10-24-2003 09:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud

All times are GMT -5. The time now is 08:05 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration