Windows 7 on ESX. New volumes are read-only

vmware-esxwindows 7

We use a mix of Windows 7 physical desktops and vitual machines (hosted on ESX). We use the same image and AD domain for both.

On the VMs, when we create a new volume, whether on an existing disk or a new one, it appears as read-only. Read-only flags are not set in diskpart, nor does clearing those flags make the disk readable. This problem does not affect our physical desktops.

Here are steps you can replicate on your Win7 system:

  1. Apply a Windows 7 image. Don't join to a domain. Log on as local
    administrator.
  2. Open computer management and browse to disk management.
  3. If Disk 0 is full, right click on the C volume and shrink it to get some free space. Or just add a hard drive in vCenter.
  4. Right-click on the unallocated space and create a new simple volume. In the wizard, give it a drive letter and format it as NTFS.
  5. Open DiskPart. In Diskpart, enter 'select disk 0' and 'select volume y' where y is the volume number of the new volume.
  6. Enter the commands 'attr disk clear readonly' and 'attr volume clear readonly'
  7. Enter 'detail disk' and 'detail volume' to verify that the read only flag is set to no.
  8. Close DiskPart and open Windows Explorer. Right-click on the new drive and bring up properties.
  9. Verify permissions are set so that the Administrators group has Full Control.
  10. Right-click on open space in Windows Explorer and notice that "New" is not in the context menu.
  11. Drag a file to the drive and get an error that the media is write-protected.
  12. Go back into properties and try to change permissions. Get "media is write protected" errors again.
  13. Repeat steps 5 – 10 until you go nuts.

If we apply this same Win7 image to a physical desktop, new volumes are read-write as normal. If we perform these steps on Server 2012 VMs on the same datacenter/cluster/datastore, new volumes are read-write as normal. If we apply this Win7 image to a VM, the volumes are read-only despite diskpart listing them as read-write.

Best Answer

VMware sent me this link. The AGM has a problem with the default way ESX mounts disks. http://kb.vmware.com/kb/1012225

From the site: To disable HotPlug capability using the vSphere Client:

  1. Connect to the ESXi/ESX host or vCenter Server using the vSphere Client.
  2. Power off the virtual machine.
  3. Right-click the virtual machine and click Edit Settings.
  4. Click the Options tab.
  5. Click General > Configuration Parameters > Add Row.
  6. Insert a new row with the name devices.hotplug and a value of false.
  7. Power on the virtual machine.
Related Topic