Is there danger in accessing a third partition from my virtualbox guest installed on a partition

by SwiftD   Last Updated June 19, 2018 00:01 AM

I recently configured my laptop to dual boot windows 10 and ubuntu 16.04.

The set up is that I have 6 partitions on a single 1TB drive, of those only 3 are set up as usable drives (rest are recovery, swap, efi). On one I have the win10 install with apps, on one I have the ubuntu install with apps, the other is a drive I have used to share data between the two setups.

I recently followed (loosely) this approach: https://lifehacker.com/how-to-dual-boot-and-virtualize-the-same-partition-on-y-493223329

So that I can now access the ubuntu partition as a virtualised guest from windows.

If you look at the referenced guide and the linked vbox docs, there are some big old warnings about letting the host/guest access one anothers partitions so i have made sure to hide these from myself on each system.

What I'm now wondering is is it safe for me to access my shared data drive simultaneously from both systems (note: it IS NOT shared as a virtualbox share - both oses have visibility of the physical disk). Is this situation likely to cause corruption?



Answers 1


The Wrong Way

Directly accessing a partition from two different operating systems via native file system drivers is extremely dangerous. This is because native fs drivers are designed with the assumption that they have exclusive access to the file system. They are not aware of each others changes to the MFT/Journal of the respective file system and there may be race conditions where both try to write to the same sector at the same time. The risk of data loss, just from having the fs mounted (not actively accessing it) is very high.

At most you should only directly mount a physical file system in a guest OS if that fs is unmounted in the host OS (and there are still risks) or mounted on the guest OS as immutable (which still won't become aware of changes the host makes).

The Right Way

The simplest and most reliable option is to use a Virtualbox shared folder mapped to the root of the file system you wish to share. I do this myself like so:

enter image description here

You can then mount the shared drive in the guest machine. You must have Virtualbox Additions installed on the guest to do so. In linux simply user the mount command with the target matching the share name and the fstype "vbox". In Windows look in Network Locations and you can right-click > Map Network Drive on the share.

Cliff Armstrong
Cliff Armstrong
June 18, 2018 23:54 PM

Related Questions


installing MS-DOS on new computer

Updated May 24, 2016 08:00 AM

No option for installing ubuntu alongside Windows 10

Updated October 14, 2017 09:01 AM