How to display VM properties

Discussions related to using VirtualBox on Windows hosts.
Post Reply
ferenczy
Posts: 6
Joined: 7. Feb 2014, 21:26
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Linux (Debian, Ubuntu)
Location: Prague, Czech republic
Contact:

How to display VM properties

Post by ferenczy »

Hi,

I couldn't find information, how to display value of a particular VM property from the command line. I mean, I can set for example value of the "natdnsproxy" property using the VBoxManage and command "modifyvm" (VBoxManage modifyvm "VM name" --natdnsproxy1 on), but how can I display the currently set value of that property? That property isn't even in the Virtualbox's GUI.

Thank you.
Dawid Ferenczy
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: How to display VM properties

Post by Perryg »

VBoxManage showvminfo <uuid|name> should show what you need.
ferenczy
Posts: 6
Joined: 7. Feb 2014, 21:26
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Linux (Debian, Ubuntu)
Location: Prague, Czech republic
Contact:

Re: How to display VM properties

Post by ferenczy »

Thank you for your answer, I have already checked that, because it's in the manual. But it's not easy to find anything in that output. It even doesn't contain "dns" anywhere. I would like to display just the value of one particular property. I have no clue, how the value of "natdnsproxy" property could be interpreted in that output.
Dawid Ferenczy
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: How to display VM properties

Post by Perryg »

Well in Linux you would use grep but Windows you would need to use something else.
You can also look at the *.vbox file but here again it is complex and full of stuff.

Simple in Linux just run a command like the following.

Code: Select all

cat /<location of guest file.vbox>/*.vbox | grep natdnsproxy
I'm sure there is a Windows substitute or you can install Cygwin and use the above command
ferenczy
Posts: 6
Joined: 7. Feb 2014, 21:26
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Linux (Debian, Ubuntu)
Location: Prague, Czech republic
Contact:

Re: How to display VM properties

Post by ferenczy »

Sure, I'm using the Cygwin for very long time. Actually grepping the output of VBoxManage showvminfo (but with -i option for case insensitive searching) was my first attempt, but without success. Also VM's .vbox file doesn't contain the string "natdnsproxy" at all. It seems, that it's stored in this XML tag in the VM's .vbox file:

Code: Select all

<DNS pass-domain="true" use-proxy="true" use-host-resolver="true"/>
under the "Adapter" node.

But that's very uncomfortable, since to find that, you have to read the whole .vbox file and think what each tag and property means and what "modifyvm" property could be related to.

There is really no way to display value of one particular VM's property from the command line?

A lot of software works for example this way:

Code: Select all

VBoxManage modifyvm "VM name" --natdnsproxy1 on   # sets property's value
VBoxManage modifyvm "VM name" --natdnsproxy1      # gets property value (since there is no value to be set)
Or there could be something like this:

Code: Select all

VBoxManage showvminfo "VM name" --natdnsproxy1
Dawid Ferenczy
Qtax
Posts: 2
Joined: 8. Jun 2016, 09:47

Re: How to display VM properties

Post by Qtax »

Exactly the same question and issue (related to getting the current value of the --natdnsproxy1 setting). It's 5 years later there is still no way to do this?
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: How to display VM properties

Post by scottgus1 »

There's nowhere in this thread indicating that a post to the Bugtracker as an Enhancement Request was made for this feature. Until that is done the developers won't know this is desired. (And it may still take some time thereafter until they find money behind the request or find it is easy to throw a couple more lines in the code, or until someone codes it for them.) You could go there and search or post.

FWIW I found that turning this on in a guest causes the line:

<DNS use-proxy="true"/>

to appear in the network section related to the # in "--natdnsproxy#".

This is with a non-commanded NAT:

Code: Select all

        <Adapter slot="0" enabled="true" MACAddress="08002750CB2D" type="Am79C973">
          <NAT/>
        </Adapter>
This is with a commanded NAT:

Code: Select all

        <Adapter slot="0" enabled="true" MACAddress="08002750CB2D" type="Am79C973">
          <NAT>
            <DNS use-proxy="true"/>
          </NAT>
        </Adapter>
And here is where I ran the command on an adapter that wasn't enabled in the guest:

Code: Select all

        <Adapter slot="2" cable="true" type="Am79C973">
          <DisabledModes>
            <NAT>
              <DNS use-proxy="true"/>
            </NAT>
          </DisabledModes>
        </Adapter>
The slot # is one less than the "--natdnsproxy#". It would take a bit of programming to show this in a command, but it could be scripted, although there may likely be other things that can be put in the NAT adapter that would have to be accounted for. A visual perusal of the .vbox file can identify this as well.
Post Reply