0

Windows Server 2012 R2 Hyper-V with CentOS 6.5 and CentOS 7 VMs.

  1. In Disk Manager, I right-click my USB hard drive and pick Offline.
  2. In Hyper-V Manager, I right-click either CentOS VM, and I connect the physical disk to either of the VMs as a SCSI drive. The drive is listed and connects without complaining.
  3. In Disk Manager, I right-click my USB hard drive and pick Online.
  4. I get a popup with the title "Virtual Disk Manager" and the text "Access is denied." and a red X icon and OK is my only option.

Any time after step 1, I notice that there is a little info bubble icon on the drive. Mousing over it says, "The disk is offline because of policy set by an administrator."

If after step 2 I detach the physical disk from the VM, step 3 works, I get the drive online again, but obviously this is not helpful in terms of accessing it from the VM.

Why is access denied? Is this to do with the drive not being passthrough-capable?

Kev
  • 964
  • 4
  • 23
  • 46

3 Answers3

2

It's not letting you "online" the disk in the host OS because it is in use by a guest OS. That was the reason that you had to take it offline in the host in the first place, to ensure that only one OS has it mounted at a time.

Jake Oshins
  • 5,116
  • 17
  • 15
1

3. In Disk Manager, I right-click my USB hard drive and pick Online.

Are you doing this on the host? If so, you're doing it wrong. It needs to remain offline on the host. Setting it Online would be done from the guest, if the guest were a Windows VM. For Linux/Unix you probably need to do some kind of mount from within the guest.

joeqwerty
  • 108,377
  • 6
  • 80
  • 171
1

When assigning a USB drive to a virtual machine, the host lose control over it. After all, a USB device can be assigned to one single machine (as a side note, USB is quite difficult to virtualize, so this situation is not going to change in the near future).

Moreover, you can not mount multiple times the same filesystem unless it is cluster aware (and NTFS is not), or you will have massive corruptions.

To share a disk between host and guests, I use the inverse approach: let the host mount the disk and then share it via SMB/NFS/FTP as needed.

shodanshok
  • 44,038
  • 6
  • 98
  • 162