SOLVED Mount old Corral VM dataset in FreeNAS 11

Status
Not open for further replies.

jzdm

Cadet
Joined
Sep 16, 2017
Messages
8
Hi there,

i recently reinstalled my FreeNAS system and switched from Corral to FreeNAS 11 and kept all zvolumes.
In Corral i had an Ubuntu VM which OS Dataset was a zvol on the Host. This zvol still exists but is not mounted in FreeNAS 11.
As there are some configurations files left inside i need access to that dataset.

Unfortunately i did not find any guide how to mount that zvol in FreeNAS 11.
Trying
zfs set mountpoint=/tmp/test Path/to/vm/name/os
fails with
cannot set property for 'Path/to/vm/name/os': 'mountpoint' does not apply to datasets of this type

Maybe you know an answer?
Thanks in advance.
 

jzdm

Cadet
Joined
Sep 16, 2017
Messages
8
Yes, it does. But with no mountpoint.
Code:
root@nas:~ # zfs list
NAME  USED  AVAIL  REFER  MOUNTPOINT
Volumename/vm/name/	20.4G  811G	96K  /mnt/Volumename/vm/name
Volumename/vm/name/os  20.4G  811G  19.4G  -
 

Stux

MVP
Joined
Jun 2, 2016
Messages
4,419

jzdm

Cadet
Joined
Sep 16, 2017
Messages
8
Is there really no simple way to solve this?
mounting within an ubuntu vm should be possible but is way to complicated in my opinion.
 

jzdm

Cadet
Joined
Sep 16, 2017
Messages
8
unsatisfactory solution:

After all i managed to boot that old VM up again. But it's really no fun if you are used to the web GUI usually.
Here are the principle steps. I am not interested in writing a complete how-to since it was a long way of try and error, retry.
Code:
# create a device map
root@nas:~ $ cat /mnt/WD10/vm/tjmwebs/device.map
(hd0) /dev/zvol/WD10/vm/tjmwebs/os

# boot into grub and select 'Ubuntu'
root@nas:~ $ grub-bhyve -r hd0,msdos1 -m /mnt/WD10/vm/tjmwebs/device.map -M 2048 ubuntu


root@nas:~ $ bhyve -A -H -P -m 2048 \
-s 0:0,hostbridge \
-s 1:0,lpc \
-s 2:0,ahci-hd,/dev/zvol/WD10/vm/tjmwebs/os \
-s 3:0,virtio-net,tap0 \
-s 4:0,fbuf,tcp=0.0.0.0:5905,wait \
-l com1,/dev/nmdm0A \
ubuntu

# in second shell between 'grub-bhyve' and 'bhyve'
# you can not quit this in a default setup
# send a SIGTERM when ready from another shell session
# In this shell you get access to the vm
root@nas:~ $ cu -l /dev/nmdm0B

# when ready remove the vm
root@nas:~ $ bhyvectl --destroy --vm=ubuntu

Websites that helped me to find the right settings are listet at the bottom.
My setup was an Ubuntu VM (which you could install from an available template) on FreeNAS Corral. This machine booted with BIOS and not UEFI! The main HDD was a raw zvol device, in my case it was /dev/zvol/WD10/vm/tjmwebs/os.
In FreeNAS 11.0 i already created a VM so the virtual network device tap0 already existed. Nonetheless, inside the VM the network device didn't start and VNC ( fbuf) didn't work either. But by calling cu -l /dev/nmdm0B one can get direct shell access to the vm.


[1] https://www.freebsd.org/doc/handbook/virtualization-host-bhyve.html
[2] https://forums.freenas.org/index.php?threads/freenas-11-vms.53801/
[3] https://www.ateamsystems.com/tech-blog/howto-windows-10-bhyve-w-freebsd-11/
[4] https://forums.freebsd.org/threads/49731/
[5] https://users.monkeybrains.net/support/bhyve
and man pages to all used commands
 
Last edited by a moderator:

m0nkey_

MVP
Joined
Oct 27, 2015
Messages
2,739
You could have booted a live OS which supports UEFI such as Ubuntu, and the UI attached the volume as a drive allowing you to simply mount it and get to your data. Seems you went the long way around in this case.

In either case, good to know you managed to get to your data.
 
Status
Not open for further replies.
Top