VM - add existing Disk

AndiM

Cadet
Joined
Dec 19, 2021
Messages
1
Hi, I want to deplay Homeassistant to my TrueNas Scale RC.
So I follwed the instructions on https://www.home-assistant.io/installation/linux and downloaded the kvm file.
I'm new to linux so please understand... ;-)
How can I add this file as a disk to my vm using TrueNAS Scale?
I copied the file to my ssd volume via winscp, but the disk is not present.

Thx
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
You first need to convert the downloaded file from a qcow2 format to raw:

qemu-img convert -f qcow2 -O raw file.qcow2 file.raw

Then you can write it into a zvol (you need to create first before this will work:

dd if=file.raw of=/dev/zvol/<pool>/<volume> bs=1m

Then add that zvol as the disk of your VM.
 

jasonmicron

Dabbler
Joined
Oct 24, 2017
Messages
15
You first need to convert the downloaded file from a qcow2 format to raw:

qemu-img convert -f qcow2 -O raw file.qcow2 file.raw

Then you can write it into a zvol (you need to create first before this will work:

dd if=file.raw of=/dev/zvol/<pool>/<volume> bs=1m

Then add that zvol as the disk of your VM.
Thanks for that! A bit of a learning curve also for those of us that aren't new to Linux but may be new to ZFS, zVOLs and TrueNAS overall ;)
 

rbprim

Cadet
Joined
Nov 4, 2022
Messages
2
I tried the same onTrueNas Scale 22.02.4 with newest homeautomation image haos_ova-9.3.qcow2 but I am not able to make the VM boot.

It hangs at the boot stage:
1667549017381.png

Also Legacy BIOS setting does not work.

My settings are:
1667549156623.png

What do I need to do for making TrueNas possible to boot the haos image? Any help is highly appreciated. Thank you!
 

spuky

Explorer
Joined
Oct 11, 2022
Messages
60
you are in the UEFI shell...

renaming the efi entrypoint could help... I only use core here would be the process for behive...
 
Last edited:

spuky

Explorer
Joined
Oct 11, 2022
Messages
60
Maybe setting the Boot to Bios (or what ever option there is helps... also )
 

rbprim

Cadet
Joined
Nov 4, 2022
Messages
2
I am using the qemu image, because TrueNas Scale uses the same virtualization platform.

I am able to boot this image now.

Solution:
I deleted the disk device and added a Raw File device which points to the converted qemu image raw file. UEFI boots now right into it.

Thanks for your help!
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
Ambiguous input redirect.
Any Idea what can be wrong with it!?
<SNARK>So, I'm getting a little tired of people posting links to tutorials they followed, but then coming here asking for help to figure out why the tutorial doesn't work... why isn't the tutorial author responsible for dealing with the problems they created by making a crappy tutorial.</SNARK>

What I suspect is happening there is that the encapsulating in pointy brackets that the tutorial author has done wasn't clear for you...

for example:
# dd if=</path/to/haos.raw> of=</dev/zvol/your-pool-name/your-zvol-name>

needs to be updated with your correct paths, but also to have the pointy brackets removed (which is where the Ambiguous input redirect error is coming from)

like this:
dd if=/path/to/haos.raw of=/dev/zvol/your-pool-name/your-zvol-name
 
Last edited:

pakka

Dabbler
Joined
Jan 25, 2018
Messages
48
you saved my day ;-)
and yes, you´re right - but the option to leave a comment on the site is disabled ;-)
 

za_skrub

Cadet
Joined
Jan 13, 2024
Messages
2
If you want to write to zvol make sure you assign ~10% extra space to it.

Also - I was able to confirm that configuring the disk controller in SCSI mode will support disks originally in IDE / AHCI (was trying to port VMs set up on another system with QEMU but there's only a select number of options available on the web portal and you can't
Code:
virsh edit
existing configs)
 
Top