Windows stopped allowing raw disk writes

Discussions related to using VirtualBox on Windows hosts.
Post Reply
Pro Ton
Posts: 3
Joined: 8. Mar 2019, 17:39

Windows stopped allowing raw disk writes

Post by Pro Ton »

And it's most likely not a problem with VirtualBox.

I have used VBoxManage to create raw partition VMDK:

Code: Select all

    dd if=/dev/sda of=/cygdrive/f/D0_MBR bs=512 count=1
    c:\Program Files\Oracle\VirtualBox>VBoxManage internalcommands createrawvmdk -filename f:\mxlinux_part2_with_mbr.vmdk -rawdisk \\.\PhysicalDrive0 -partitions 2 -mbr f:\D0_MBR
And I have very weird issues with it.
First, I was able to almost complete Linux installation inside VM and I can see some effect on the disk. But at some point VM started ignoring all writes to sda2 while reading data correctly without me changing anything. I found VERR_IO_NOT_READY error in VirtualBox log.
VirtualBox can refuse to start VM at times because of access error (VERR_VD_IMAGE_READ_ONLY, this looks like CreateFile resulting in "SHARING VIOLATION" in ProcessMonitor). VM can be paused due to this error, Linux host can report "check if no disk space left". I see WriteFile (to Harddisk0) operations in ProcessMonitor with result "0x80000010" and I cannot reproduce these right now because VM fails to start.

Now, the problem is that I cannot do anything to the raw disk using HexEditor in Windows too! It calls FlushBuffersFile which fails with "INVALID DEVICE REQUEST".
Different Hex Editor causes same error as VirtualBox (WriteFile with 0x80000010).

Disks are not set to read-only.

Code: Select all

DISKPART> list volume

  Volume ###  Ltr  Label        Fs     Type        Size     Status     Info
  ----------  ---  -----------  -----  ----------  -------  ---------  --------
  Volume 0     C   W7SP1x64     NTFS   Partition     78 GB  Healthy    System
  Volume 1                             Partition     34 GB  Healthy    Offline
  Volume 2     G   SV_pomooika  NTFS   Partition    819 GB  Healthy    Pagefile
  Volume 3     E   raid1        NTFS   Partition    931 GB  Healthy

DISKPART> select volume 1

Volume 1 is the selected volume.

DISKPART> attributes volume
Read-only              : No
Hidden                 : No
No Default Drive Letter: No
Shadow Copy            : No

DISKPART> select disk 0

Disk 0 is now the selected disk.

DISKPART> attributes disk
Current Read-only State : No
Read-only  : No
Boot Disk  : Yes
Pagefile Disk  : Yes
Hibernation File Disk  : No
Crashdump Disk  : Yes
Clustered Disk  : No
I also tried to enable host I/O cache as suggested in different threads for different errors (but there is no sense in doing so since I cannot even HexEdit the disk in Windows). What else should I check?
Attachments
VBox.log - Copy.zip
(29.93 KiB) Downloaded 14 times
Pro Ton
Posts: 3
Joined: 8. Mar 2019, 17:39

Re: Windows stopped allowing raw disk writes

Post by Pro Ton »

It seems that Windows allows me to write past last partition and to non-primary disks. What should I do to allow VB to write to Harddisk0?
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Windows stopped allowing raw disk writes

Post by mpack »

VirtualBox uses the host OS to write to the disks, whether at file or disk level. It can't do that if the host OS doesn't allow it, and there is nothing you can do about it in VirtualBox. You need to fix the host OS.

AFAIK the procedure for fixing permissions on Windows hosts has not changed since Win7. viewtopic.php?f=6&t=38914#p175089
Pro Ton
Posts: 3
Joined: 8. Mar 2019, 17:39

Re: Windows stopped allowing raw disk writes

Post by Pro Ton »

I have already checked it and I mentioned it above. Other than that, Windows even allows writes past all partitions.
Post Reply