possible to use VirtualBox on macOS with ZFS?

All your general support questions for OpenZFS on OS X.

possible to use VirtualBox on macOS with ZFS?

Postby tangles » Tue May 02, 2017 4:20 am

Hi,

I've just googled for a howto and haven't had much luck finding anything:

macOS
ZFS installed
VirtualBox installed
create a VM that uses a ZFS file.

I'm using mkfile to create a 20g file,
Code: Select all
mkfile -n 21g /Users/shared/VirtualMachines

then the zpool command pointing to the newly created file.
Code: Select all
sudo zpool create -f -o ashift=13 -O checksum=edonr -O casesensitivity=insensitive -O atime=off -O normalization=formD VirtualMachines /Users/Shared/VirtualMachines


This all worked as expected and ZFS mounted the pool on the desktop, which is where I start to question what I'm doing.
I thought the zvol should never get mounted as I want it to be available for VirtualBox VMs and not be exposed to macOS.

I then found using VirtualBox's command line tools to create a vmdk wrapper around the zvol.
Code: Select all
VBoxManage internalcommands createrawvmdk -filename ~/.VirtualBox/VirtualMachines -rawdisk /Volumes/VirtualMachines

which worked, but when I create a new VM and navigate to /Users/Shared/VirtualMachines, I get an error...

I know this is just as much to do with VirtualBox as it is with ZFS, but was wondering if anyone could point to a URL that has done this on macOS?

ta.
tangles
 
Posts: 195
Joined: Tue Jun 17, 2014 6:54 am

Re: possible to use VirtualBox on macOS with ZFS?

Postby haer22 » Sun May 07, 2017 7:00 am

Your
Code: Select all
zpool create ...
command created a filesystem that was mounted at /Volumes/VirtualMachines. And your VM manager want a rawdisk.

I think what you want is to create a ZFS vol with
Code: Select all
zfs create -V 15g ....
which will give you a virtual disk that will show up as /dev/diskNN. I guess MacOS will complain that an unititalized disk has popped up. However, that ZFS vol is a "raw disk".

But it seems a bit convoluted still what you need to do. I guess you could also make a new 20g fil somewhere in /Volumes/VirtualMachines/subdir and point your VM manager there.
haer22
 
Posts: 123
Joined: Sun Mar 23, 2014 2:13 am

Re: possible to use VirtualBox on macOS with ZFS?

Postby JasonBelec » Wed Aug 16, 2017 3:55 pm

Yeah, several threads exist on this across the internet. You looked poorly.

You really have to understand how Virtualbox works, it's weird but with good reason.

You are however not clear in the actual goal your shooting for. I have several VM's stored on ZFS that spool up at the drop of a hat. I have a test VM that mounts the drives directly, bypassing the host machine as well for a Linux environment. I have a VM in a ZVOL as well for kicks, all work fine.

So what is it you really trying to do?
JasonBelec
 
Posts: 32
Joined: Mon Oct 26, 2015 1:07 pm


Return to General Help

Who is online

Users browsing this forum: No registered users and 8 guests