Page 1 of 1

VBoxManage get mapped drive letters.

Posted: 18. Sep 2014, 13:47
by Captain_Planet
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.

Re: VBoxManage get mapped drive letters.

Posted: 18. Sep 2014, 14:50
by mpack
Moving this topic to "Windows Guests".

Re: VBoxManage get mapped drive letters.

Posted: 18. Sep 2014, 15:20
by scottgus1
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.

Re: VBoxManage get mapped drive letters.

Posted: 18. Sep 2014, 17:20
by Captain_Planet
Thanks. But I've had a look here already:

https://www.virtualbox.org/manual/ch08. ... stproperty

Can't seem to find anything. Hmmm.

Re: VBoxManage get mapped drive letters.

Posted: 18. Sep 2014, 21:01
by scottgus1
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.

Re: VBoxManage get mapped drive letters.

Posted: 18. Sep 2014, 23:07
by mpack
The label which a guest OS chooses to assign to a device is entirely up to that guest OS.