0

I have a Windows 10 host running on a 240 GB SSD (disk A) and a Linux VM running on another 240 GB SSD (disk B). I am moving this linux host from a full desktop machine where I had a 2 TB HDD (disk C) and I backed up the entire home directory to this disk.

On the Windows host, I can boot up the linux VM, but I can't see 2 TB disk to mount it. How can I expose disk C to the VM running on disk B so that it can be mounted and I can use all the files which I previously had stored on it?

2
  • what VM program are you using? I know for VMWare, you need to share the drive/folder with the client in the host software, and then mount it in the client. askubuntu.com/questions/29284/… I think virtualbox is similar,
    – Aaron Ladd
    Commented Dec 30, 2015 at 14:11
  • I'm using virtualbox. I was hoping to hide disk C completely from the host OS.
    – drjrm3
    Commented Dec 30, 2015 at 14:16

1 Answer 1

0

You have two questions here, one is to mount the existing drive/folder/etc., the other is to hide the drive from the host (Windows) OS.

In Virtualbox, mounting a shared folder is fairly straightforward, after sharing the folder with the guest in the VM settings in Virtualbox, you can run sudo mount -t vboxsf share ~/host which should mount the folder/drive in the host folder in your home directory.

Hiding the drive is less simple. I imagine that formatting the drive as ext4 and giving control of the sata interface to the guest would an option (note this would erase all the data currently on the drive). Windows will recognize an ext4 partition as a partition, but not be able to mount it in explorer (without additional tools). the first thing to do would be to mount the drive directly. In the user manual, this is not addressed, but here it seems fairly straightforward, you make a virtual hard disk image and map it to the partition/drive in question:

VBoxManage internalcommands createrawvmdk -filename "C:\Users\<user_name>\VirtualBox VMs\<VM_folder_name>\<file_name>.vmdk" -rawdisk \\.\PhysicalDrive#.

to find the physical drive number:

In Windows, open Disk Management. You'll see the associated drive numbers on the left and will identify them later as PhysicalDrive0, PhysicalDrive1, etc.

I would start with the drive as it is, and only play around with formatting after you have a working mount.

Why are you trying to hide the drive from windows? This seems very complicated, and there are many potentially dangerous problems that can arise from giving guests RAW level access to disks, although if there is nothing else using the disk, I don't see that being as big an issue.

3
  • I do not want to format the drive as it has important information on it. The drive is already ext4 (brought it over from another linux box) and Windows is not. I want to hide it from Windows (host) since I will ever be accessing it from Windows, though if I have to mount it in Windows to share it with the VM then that might be ok.
    – drjrm3
    Commented Dec 30, 2015 at 18:21
  • For mounting the entire drive, the process is making a "virtual drive" file that points to the real drive (or partition) in the above answer.
    – Aaron Ladd
    Commented Dec 30, 2015 at 19:51
  • If you open the partition manager in windows it will see the drive, but not be able to mount it.
    – Aaron Ladd
    Commented Dec 30, 2015 at 19:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .