VBoxManage.exe and Windows 10

Discussions related to using VirtualBox on Windows hosts.
Anty666
Posts: 11
Joined: 28. Dec 2021, 04:40

VBoxManage.exe and Windows 10

Post by Anty666 »

Code: Select all

VirtualBox 6.1.30 r148432 (Qt5.6.2)
Windows 10 pro x64 21H2
sorry for my English. I write using a translator.

Hi.
I want to install as a guest OS Debian10x64. Normal installation and configuration does not cause problems for me.

1. I am interested in using a physical disk partition. In my case it is Disk 1 Part 3. Firstly, I would like to receive more detailed instructions on this matter. Little attention is paid to Windows in the official help.

2. Secondly, VBoxManage.exe does not work for me. When I run it, I get the message: This application cannot be launched on your PC. To find the version for your computer, contact the publisher of the application. I've tried using compatibility mode but it doesn't help.
Image 1.png
Image 1.png (20.47 KiB) Viewed 7131 times
Image 2.png
Image 2.png (8.34 KiB) Viewed 7131 times
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: VBoxManage.exe and Windows 10

Post by mpack »

On Windows hosts you must provide a complete path to VBoxManage, or add the VirtualBox program folder to your default search path.

I don't like to do either, so instead I use a trick: I put a file called "VBoxManage.bat" somewhere on the existing path, e.g. in the C:\Windows folder. This solution, along with an example bat file, is described here: Howto: Run VBoxManage without having to type the program path.
Anty666
Posts: 11
Joined: 28. Dec 2021, 04:40

Re: VBoxManage.exe and Windows 10

Post by Anty666 »

mpack wrote:On Windows hosts you must provide a complete path to VBoxManage, or add the VirtualBox program folder to your default search path.

I don't like to do either, so instead I use a trick: I put a file called "VBoxManage.bat" somewhere on the existing path, e.g. in the C:\Windows folder. This solution, alon...
I've already done that.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: VBoxManage.exe and Windows 10

Post by mpack »

You have already done what? I mentioned a couple of alternatives.

It's strange that when I do a search for "This application cannot be launched on your PC", I only get hits on Russian sites. If this does not mean what I thought (a misleading translation of "VBoxManage is not recognized"), then the only thing I think it could mean is missing DLLs - implying that VirtualBox was not installed correctly.

Incidentally: please turn off any "compatibility mode" options you enabled. VirtualBox is actively maintained, not a relic from Win9x. It doesn't need help to be compatible with modern Windows, and enabling a compatibility mode will just cause confusion when the foreground and background tasks think they are running on different Windows versions.
Anty666
Posts: 11
Joined: 28. Dec 2021, 04:40

Re: VBoxManage.exe and Windows 10

Post by Anty666 »

mpack wrote:You have already done what? I mentioned a couple of alternatives.
The screenshots show what I was doing.
Image 4.png
Image 4.png (37.6 KiB) Viewed 7068 times
Image 3.png
Image 3.png (126.06 KiB) Viewed 7068 times
Image 2.png
Image 2.png (42.07 KiB) Viewed 7068 times
mpack wrote:It's strange that when I do a search for "This application cannot be launched on your PC", I only get hits on Russian sites. If this does not mean what I thought (a misleading translation of "VBoxManage is not recognized"), then the only thing I think it could mean is missing DLLs - implying that VirtualBox was not installed correctly.
Do you think it is worth reinstalling the program? Or look for specific files DLLs?
mpack wrote:Incidentally: please turn off any "compatibility mode" options you enabled. VirtualBox is actively maintained, not a relic from Win9x. It doesn't need help to be compatible with modern Windows, and enabling a compatibility mode will just cause confusion when the foreground and background tasks think they are running on different Windows versions.
I understand it. But the problem puzzled me. I have disabled compatibility mode for now because it doesn't help.
Anty666
Posts: 11
Joined: 28. Dec 2021, 04:40

Re: VBoxManage.exe and Windows 10

Post by Anty666 »

mpack wrote: It's strange that when I do a search for "This application cannot be launched on your PC", I only get hits on Russian sites. If this does not mean what I thought (a misleading translation of "VBoxManage is not recognized"), then the only thing I think it could mean is missing DLLs - implying that VirtualBox was not installed correctly.
Ok. Removing and installing didn't help. The installation and subsequent installation helped with the repair function. as a result, VBoxManage.exe started working.

Now I have a question of how exactly to do everything? For example, the official instructions do not contain a complete list of VBoxManage commands for Windows CMD.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: VBoxManage.exe and Windows 10

Post by mpack »

Anty666 wrote:For example, the official instructions do not contain a complete list of VBoxManage commands for Windows CMD.
In fact the official documents do provide precisely that: https://www.virtualbox.org/manual/UserM ... vboxmanage.
Anty666
Posts: 11
Joined: 28. Dec 2021, 04:40

Re: VBoxManage.exe and Windows 10

Post by Anty666 »

mpack wrote: In fact the official documents do provide precisely that:
I have attached screenshots. This is all the information on how to build a team in Windows. I have already looked into this.
Image 2.png
Image 2.png (2.46 KiB) Viewed 7039 times
Image 3.png
Image 3.png (3.96 KiB) Viewed 7039 times
Image 4.png
Image 4.png (4.25 KiB) Viewed 7039 times
\\.\PhysicalDrive0 - Indicates the hard drive itself.
I need to point to the hard disk partition as well. How to do it?
so

Code: Select all

\\.\PhysicalDrive0Partition3
or

Code: Select all

\\.\PhysicalDrive0 Partition3
or

Code: Select all

\\.\PhysicalDrive0\Partition3
or

Code: Select all

\\.\PhysicalDrive0Part3
or

Code: Select all

\\.\PhysicalDrive0 Part3
or

Code: Select all

\\.\PhysicalDrive0\Part3
or

Code: Select all

\\.\PhysicalDrive0 -Partition3
or

Code: Select all

\\.\PhysicalDrive0 -Partition 3
or

Code: Select all

\\.\PhysicalDrive0 -Part3
or

Code: Select all

\\.\PhysicalDrive0 -Part 3
or

Code: Select all

maybe something else?
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows, Linux

Re: VBoxManage.exe and Windows 10

Post by scottgus1 »

In the 'individual partitions' section of Raw Disk Access, the command for adding partitions is shown thus:

Code: Select all

VBoxManage internalcommands createrawvmdk -filename \
path-to-file.vmdk -rawdisk /dev/sda -partitions 1,5
The final backslash on the first line is a 'line continuation' character, meaning the command can be:

Code: Select all

VBoxManage internalcommands createrawvmdk -filename path-to-file.vmdk -rawdisk /dev/sda -partitions 1,5
For Windows hosts this would theoretically be:

Code: Select all

VBoxManage internalcommands createrawvmdk -filename path-to-file.vmdk -rawdisk \\.\PhysicalDrive0 -partitions 1,5
Substitute the correct numbers for your desired partitions.

Raw Disk Access on Windows Hosts requires these things:
  1. All things in the Raw Disk Access setup related to Virtualbox must be Run As Administrator, even if you already have admin privileges.
  2. The disk being Raw-Disk-Accessed must be "Offline" in the Disk Management console.
Point 2 prevents the boot disk or partitions thereof from being Raw-Disk-Accessed on a Windows host, because the boot disk cannot be taken off-line. So if "Disk 1 Part 3" above is the boot disk, this won't work on a Windows host. Also note that one day Disk 1 could point to a different disk than it does today, and Raw Disk Access could mess up good data.

Windows prevents Point 2 from working on a USB-attached drive: Windows won't let USB drives go Offline in Disk Management.
Anty666
Posts: 11
Joined: 28. Dec 2021, 04:40

Re: VBoxManage.exe and Windows 10

Post by Anty666 »

scottgus1 wrote:VBoxManage internalcommands createrawvmdk -filename path-to-file.vmdk -rawdisk \\.\PhysicalDrive0 -partitions 1,5
Woo!!! Fabulous. Thank you very much. I can finally get started.
Anty666
Posts: 11
Joined: 28. Dec 2021, 04:40

Re: VBoxManage.exe and Windows 10

Post by Anty666 »

scottgus1 wrote:VBoxManage internalcommands createrawvmdk -filename path-to-file.vmdk -rawdisk \\.\PhysicalDrive0 -partitions 1,5
This does not work. Regardless of the choice of the hard disk partition, its full size is still displayed.
Sorry for the image quality. I had to reduce the size.
2.png
2.png (81.56 KiB) Viewed 7008 times
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows, Linux

Re: VBoxManage.exe and Windows 10

Post by scottgus1 »

I have not ever tried to Raw Disk Access a single host disk partition. But I do see that the disk appears to still be online in the host Disk Management, which in my experience won't let the Raw Disk Access work:
scottgus1 wrote:2. The disk being Raw-Disk-Accessed must be "Offline" in the Disk Management console.
Anty666
Posts: 11
Joined: 28. Dec 2021, 04:40

Re: VBoxManage.exe and Windows 10

Post by Anty666 »

scottgus1 wrote: But I do see that the disk appears to still be online in the host Disk Management, which in my experience won't let the Raw Disk Access work
That is, the entire disk must be disconnected. Even if I use one partition? It is sad.
If so, I'll connect another hard drive to the system. And I will completely leave it to the virtual machine. Just found one at home. :) Among other things, I think it will be safer.

Thank you very much for your consultation. And I apologize for the nerves you all have worn out. ;)
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows, Linux

Re: VBoxManage.exe and Windows 10

Post by scottgus1 »

Anty666 wrote:the entire disk must be disconnected. Even if I use one partition?
Yes. 'Tis what it is. Seems to be a Windows-imposed limitation, since Linux allows Virtualbox to access only partitions.
Anty666 wrote:I apologize for the nerves you all have worn out.
Not at all. The deeper things are always fun to look into.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: VBoxManage.exe and Windows 10

Post by mpack »

Anty666 wrote: That is, the entire disk must be disconnected. Even if I use one partition? It is sad.
Raw access could hardly mean anything else.

You have a physical disk. Above that is a driver level that reads and writes sectors. Above that is an OS filesystem layer that interprets (mounts) partitions on the drive. If you access the drive at the driver level then there are no partitions. This is raw access, and Windows hosts require that for security reasons all partitions are unmounted before sector level access can be granted.

Why are you even trying to mess around at this level? It doesn't sound like you know enough to do it safely, and a mis-step could corrupt your drive. If you're doing this because you are under the impression that bypassing filesystem caching will give you a faster drive then I'm afraid that would be very wrong.
Post Reply