Hi.
Is there any way to use VBoxManage.exe to get drive mappings on a virtual machine from the host? For example, C:\ is mapped to hard disk 1. D:\ is mapped to CD Rom etc. Or failing that, is there a way to retrieve an environment variable such as %SystemDrive% without the VM in a running state?
Thanks.
VBoxManage get mapped drive letters.
-
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 get mapped drive letters.
Moving this topic to "Windows Guests".
-
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 get mapped drive letters.
All of the commands for Vboxmanage are in the manual. There's a program in the guest, part of the Guest Additions, called Vboxcontrol, which also is described in the manual. You can poke around to see if any commands may help you.
You may also need to run a script in the guest using whatever programming capabilities in the guest, which could generate a text file formatted for use in the host, which can be passed through a shared folder. Since you mention Microsoft-style drive mappings and environment variables, you might try the WMI Scriptomatic from the Microsoft Scripting Guys, very useful for getting a start on things like this.
You may also need to run a script in the guest using whatever programming capabilities in the guest, which could generate a text file formatted for use in the host, which can be passed through a shared folder. Since you mention Microsoft-style drive mappings and environment variables, you might try the WMI Scriptomatic from the Microsoft Scripting Guys, very useful for getting a start on things like this.
-
Captain_Planet
- Posts: 9
- Joined: 10. Jul 2014, 14:54
Re: VBoxManage get mapped drive letters.
Thanks. But I've had a look here already:
https://www.virtualbox.org/manual/ch08. ... stproperty
Can't seem to find anything. Hmmm.
https://www.virtualbox.org/manual/ch08. ... stproperty
Can't seem to find anything. Hmmm.
-
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 get mapped drive letters.
Using "VBoxManage guestproperty enumerate <yourguestname>" will show you all the guest properties Virtualbox comes built in with. You can use "guestproperty" to pass custom data back and forth also, but it seems drive letter mapping is not one of the items Virtualbox generates. You're going to have to come up with you own solution on this one. Another source that would help you is getting the Visual Basic Scripting documentation for the vbscript language built-into Windows guests.
-
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 get mapped drive letters.
The label which a guest OS chooses to assign to a device is entirely up to that guest OS.