Importing a large (> dom0 disk size) standalone VM

Hi,

The QubesOS documentation provides instruction on importing OVA files, but it includes a full copy of the VM disk to dom0 storage, which in my case is not possible, as I have ~10GB of free space in dom0 (but plenty of space in the Xen disk pool), and the VM disk is ~50GB.

Is there a way to transfer the disk file, from the AppVM where I have it downloaded, to the Xen disk pool, without this intermediate copy to dom0 ?

Thanks in advance

PS: You may wonder, why do you need to import 50GB VMs ?
At university, we are usually provided with labs, in the form of VirtualBox VMs (.ova files), and these can be relatively large.

2 Likes

It’s possible with a named pipe (FIFO). You have to do the volume import separately after VM creation, because qvm-create cannot automatically detect the correct volume size in this case so it has to be passed manually - which is only implemented for qvm-volume import.

Continuing after the qemu-img convert step:

[user@dom0 ~]$ mkfifo /tmp/fifo
[user@dom0 ~]$ qvm-run --pass-io untrusted 'cat "/media/user/externalhd/win10.raw"' > /tmp/fifo

While this^ is still running, open another terminal and:

[user@dom0 ~]$ qvm-create --property=virt_mode=hvm --property=memory=4096 --property=kernel='' --label=red --standalone win10
[user@dom0 ~]$ qvm-run --pass-io untrusted 'stat -c %s "/media/user/externalhd/win10.raw"'
53687091200
[user@dom0 ~]$ qvm-volume import --size=53687091200 win10:root /tmp/fifo
[user@dom0 ~]$ rm /tmp/fifo
8 Likes

hi,

im getting an error when trying to import a debian .ova for my standalone vm.

After qvm-run --pass-io untrusted 'stat -c %s "/media/user/externalhd/win10.raw"' 53687091200

i get qvm-run: error: no such domain: 'untrusted'

where should my *.raw file be located?

Thanks

Have you already converted your .ova file to raw? If not, follow the steps here:

Once you have the .raw file, get the current name of your qube where the .raw is located and edit the command with the correct name and path within that qube.

Yes, the problem here looks to be that you havent used the right qube name.
Check that.

thanks for the speedy response. Yes i had already converted the ova to raw. I continued the steps from official documentation to rustybird’s solution.

Where should my raw file be located? I dont have enough space in dom0 for the .ova

I’ll give it another go and update here

It should be in a qube of your choice, give it the necessary disk size to handle the raw file (if it resides on an external drive, mount it inside the qube instead), and then use the qvm-run commands with the name of that qube (replace untrusted in the commands with that name) and the path (between quotes) where the raw file is located inside it.

Command example if the qube is named convert and the path of the raw file inside it is /home/user/Downloads/file.raw:

qvm-run --pass-io convert 'cat "/home/user/Downloads/file.raw"' > /tmp/fifo

while executing qvm-run --pass-io convert 'cat "/home/user/Downloads/file.raw"' > /tmp/fifo Terminal doesnt do anything. Is something supposed to happen here?

I opened a new terminal as the other one is still running and continued the next instructions

i created the new vm using the commands

but for the next step, i executed the command qvm-run --pass-io untrusted 'stat -c %s "/home/user/Downloads/file.raw"' 53687091200

and got the error
`Traceback (most recent cal last):
File '/usr/bin/qubes-vmexec", line 5, in
sys.exit (main))
^^^^^^

file “/usr/lib/python3.12/site-packages/qubes/agent/vmexec.py”, line 55, in mail

os.execvp(command[0], commad)
file “”, line 580, in execvp
file “”, line 603, in execvpe
fileNotFoundError: [Errno 2] No such file or directory`

You need to replace with the name of your qube and use the correct path where the raw file is. You are using a command with qube “convert” first and then change to qube “untrusted” which won’t work. Both commands need to use the same qube name.

sorry, i got lazy and copied the commands from this thread. But I did use the proper naming conventions and directories.

Decided to start from scratch and went with ‘convert’ as the appvm name to make things easier. I got the same exact error as last time.

im using fedora-39 template

The error you get seems to indicate that the path you set is incorrect (it can’t find the file there). Make sure the path is the correct one in the qube you are using in the same command. Also, do not include the number at the end (53687091200), this is just an example of what the command will output.

1 Like

Should there be a virtualbox .zip file? It is mentioned in the qubes docs but all i have is a .ova

also, just confirming… These steps are all done in dom0 terminal correct? (Importing a large (> dom0 disk size) standalone VM - #2 by rustybird)

okay, removing the 53687091200 seemed to make it work now.

After entering qvm-run --pass-io untrusted 'stat -c %s "/home/user/Downloads/file.raw"' it displays 53687091200. That was a bit confusing. I thought i had to put those numbers in the command. Silly Me!

After finishing with qvm-volume import --size=53687091200 *nameofmynewstandalone*:root /tmp/fifo
i start my standalone and now its not booting…
Pleaes see screenshot. Its stuck at this screen for 20 mins

Are you sure that the VM worked initially? If it did, you can try redoing everything from the beginning. If the kernel does not start, something is wrong and needs deep troubleshooting.