1

So on my Laptop I dual boot Arch Linux and Open BSD 6.9.

What I want to do is to within Arch Linux be able to boot my Open BSD partition using Virtal Box, use the BSD operating system normally in the virtual environment, and then have any changes made during my Virtual Box session to be saved to my disk partition for Open BSD.

So in effect when I actually physically boot into the Open BSD Partition all my 'Virtual Changes' are reflected.


I understand it is possible to do the booting part as described here: Use VirtualBox to boot a physical drive/partition

but at least as far as I can tell the changes are not saved to the physical disk, but instead to a .vmdk.

I have also read this answer: Moving an OS from a virtual box to the hard disk

that seems to suggest that one can make a conversion from a virtal image to a physical one.

A potential solution might be making some bash scripts that perform all this, but before I go down that route I would like to see if there is an integrated solution in Virtal Box proper.


My question is this possible and if so is it adviable? I imagine corrupting data is a big concern, and there are certain things like mounting the host disk parition in virtual environment which are a big no-no.

1 Answers1

1

The answer that you need to follow wrt to VirtualBox being able to use physical disk partition is this one. I suggest you read manual for VirtualBox, chapter 9.7.1.2. Access to Individual Physical Hard Disk Partitions before following that answer.

If you correctly understand that chapter and execute the commands in accordance with your case, you should be able to access and modify whole harddisk or a specific partiton (-relative flag) with ease. I can tell you whatever you would do in the assigned physical partition from within the VirtualBox would make permanent changes. They are not temporary or in memory! I had installed my Arch Linux in a real partition by assigning the target physical partition to Virtualbox using relative flag so as to prevent myself from accidentally deleting or modifying partition table or other partitions when installing Arch Linux.

That said, I don't suggest you do such a thing at all. If your intention is to learn an OS, don't bother accessing physical partition through VirtualBox. Just take backup of your Open BSD files and save them in a virtual hard disk that you can use easily in VirtualBox. When you feel like committing fully to only using Open BSD on a physical partition then move the files from virtual hard drive back to the partition of your choice (you would have to reconfigure the bootloader though -- shouldn't be a problem).

This approach prevents you making silly mistakes with Virtualbox commands that can corrupt your partitions.

Firelord
  • 366
  • 1
  • 13