general/other Is it possible to run an existing (Linux) installation on a hard drive as a bhyve instance?

I was wondering if it's possible to run a Ubuntu installation on a hard drive/partition as an instance of emulation on FreeBSD?

I know bhyve/virtual box provide virtualization environments from scratch (so to speak) but interested to know if it's possible to run an existing Ubunut/Linux installation from within FreeBSD by perhaps pointing/mounting to the install drive/partition
 
You should be able to attach a real physical disk instead of a disk image to a vm. Never tried to do this myself but theoretically this should definitely be possible.
 
For bhyve(8) see Thread hard-drive-pass-thru-bhyve.66295 and https://github.com/churchers/vm-bhyve/wiki/Virtual-Disks#custom-disk .

For VirtualBox see https://www.virtualbox.org/manual/UserManual.html#adv-storage-config.

Be sure to note the warning regarding boot attempts of currently running host system in a guest.

I suggest you practice with a non-critical disk first before attempting to attache a disk with valuable data. It can be a Live OS on a USB stick.

Also, make sure to have a backup of the important data from the disk you want to attach, just in case.
 
You should be able to attach a real physical disk instead of a disk image to a vm. Never tried to do this myself but theoretically this should definitely be possible.

My system already has wifibox installed for higher speeds with the linux kernel wireless interface.

I basically have a hard drive with linux installed on it - it's /dev/nvd0(p1) - it's a secondary drive. Now when I try the example commands on the bhyve man page by replacing it with the same - it somehow doesn't work - this is the command
bhyve -c 2 -s 0,hostbridge -s 1,lpc -s 2,virtio-blk, /dev/nvd0 -l com1,stdio -A -H -P -m 1G vm1
The result is it simply outputs the proper usage of the command, not some error - maybe I am doing something from? I tried the same with p1 as well at the end to specify the partition.

Are there any examples to simply attach an existing disk of linux installed and run it as an bhyve instance?
Be sure to note the warning regarding boot attempts of currently running host system in a guest.

I suggest you practice with a non-critical disk first before attempting to attache a disk with valuable data. It can be a Live OS on a USB stick.

Also, make sure to have a backup of the important data from the disk you want to attach, just in case.
I could also try it on a backup disk (/dev/da0) but the result was similar - I suppose I could just get it running and copy backed up contents later once I resolve how to run a linux bhyve
Suppose you might want to look at raw devices?
Isn't this for installing something from scratch?
 
In this context it might indeed not be needed. If you make an img of the external drive you might be able to run it within freebsd. Installing a new one would be just as easy I think.
 
Assuming you are using linux with graphicss, have a look here.
You will also probably need to copy /boot/efi/EFI/debian/grubx64.efi to /boot/efi/EFI/BOOT/bootx64.efi
 
In this context it might indeed not be needed. If you make an img of the external drive you might be able to run it within freebsd. Installing a new one would be just as easy I think.
What is not needed - zvol? I already have an existing installation that I'm trying to get to work. Life would have been much simpler if there were examples on how to attach an existing drive to run as bhyve guest.
Assuming you are using linux with graphicss, have a look here.
You will also probably need to copy /boot/efi/EFI/debian/grubx64.efi to /boot/efi/EFI/BOOT/bootx64.efi
I did go through the handbook and the man page - but it seems a little confusing, maybe I am just not able to understand it. The examples seem to refer to running things from scratch - couldn't find an example where the bhyve vm instance to be run in a disk.
 
Back
Top