Projects like OPNsense.org provide you with an .img file that you would dd to a USB device to boot from. This is not obvious how to use from VirtualBox. You need to convert that into a VMDK file. Basically, the command I used was:
vboxmanage convertfromraw OPNsense-19.7-OpenSSL-serial-amd64.img /tank/VMs/4544-opnsense-19-freebsd/opensense-19.7-usb.vmdk –format vmdk
Then attach that VMDK file to your virtual SATA controller and when you boot really quick! Hit F12 and choose option 2. That’s your USB device.
Upgrades! Sometimes they are a lot of homework.
Enabled Centos-Plus repos and elrepo for recent kernels. I figured out I want to install kernel-ml, kernel-ml-headers, kernel-ml-devel. That last one escaped me but is necessary because you need it when you do a dkms install.
So after updating that stuff, I was able to dkms install spl/0.6.5.3, dkms install zfs/0.6.5.3. I also made sure to modprobe spl zfs. Linked /usr/lib/systemd/system/zfs.target into /etc/systemd/system/sysinit.target.wants. Reboot. Make sure zfs pool returns.
To get vboxdrv all working I needed to make sure I installed the vboxdriver. That is /usr/sbin/rcvboxdrv. Easy to forget, that’s rather new. Then (as root) do a vboxmanage extpack install ~/Downloads/VirtualBox-extpack-5.0.6.extpack and that will keep your guest vms from blocking on missing USB-UHCI drivers.
Then go back and read my prev post on updating grub. I kept booting into kernel 3.10.x and wondering why grub2-install /dev/sda wasn’t doing it’s job. Ubuntu did the right amount of work with the update-grub2 script, I’ll say.
I have created a lot of VMs with VirtualBox and I organize their snapshotting with ZFS.
VMs Organized as ZFS sub volumes
I have gotten about as far as I can go…I can boot a Fedora netinstall cd, and I can attempt to fdisk /dev/sda, but this device will not open in fdisk. This might be consistent with no “rdsk” device in the dev tree. Funny though, I can fdisk /dev/zd0, and it lists partitions.
Could this be a problem with how I have my vmdk setup?
I am trying to create zvol backed virtualbox guests using ZFS on Linux. Hopefully this is not too ambitious.
- Find size of original .VDI disk image: vboxmanage showhdinfo Fedora19.vdi
- Pass that file size into zfs create: zfs create -V40960M tank/VMs/Fedora19
- Convert .vdi file to raw, best if you can do this from one hd to another. In my case I’m reading from a zvol and writing to an ssd: vboxmanage clonehd Fedora19.vdi ~/tmp/Fedora19.raw –format RAW
- Load that back into a raw parition image: dd if=~/tmp/Fedora19.raw of=/dev/zvol/tank/VMs/9101-f19 bs=1280k
- now we can check partitions: vboxmanage internalcommands listpartitions –rawdisk /dev/zvol/tank/VMs/9101-f19
- Then we can create a vmdk file for the raw parition: vboxmanage internalcommands createrawvmdk -filename ~/VirtualBox\ VMs/9101-f19/9101-f19-B.vmdk -rawdisk /dev/zvol/tank/VMs/9101-f19 -partitions 1,2,3
- create an idea controller: vboxmanage storagectl …vboxmanage storagectl 9101-f19-B –name IDE –add ide
- add blank version of hard drive: vboxmanage storageattach 9101-f19-B –storagectl IDE –port 0 –device 0 –mtype normal –type hdd –medium none
- add hard drive: vboxmanage storageattach 9101-f19-B –storagectl IDE –port 0 –device 0 –mtype normal –type hdd –medium “/home/jreynolds/VirtualBox VMs/9101-f19-B/9101-f19-B.vmdk”
- …attach the CD rom and then repair the system…somehow my disk image stopped being bootable. :-(