How to display VM properties

Discussions related to using VirtualBox on Windows hosts.

How to display VM properties

Postby ferenczy » 27. May 2014, 21:43

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
ferenczy
 
Posts: 6
Joined: 7. Feb 2014, 21:26
Location: Prague, Czech republic
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Linux (Debian, Ubuntu)

Re: How to display VM properties

Postby Perryg » 27. May 2014, 21:57

VBoxManage showvminfo <uuid|name> should show what you need.
Perryg
Site Moderator
 
Posts: 34373
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: How to display VM properties

Postby ferenczy » 27. May 2014, 23:17

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
ferenczy
 
Posts: 6
Joined: 7. Feb 2014, 21:26
Location: Prague, Czech republic
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Linux (Debian, Ubuntu)

Re: How to display VM properties

Postby Perryg » 28. May 2014, 00:28

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   Expand viewCollapse view
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
Perryg
Site Moderator
 
Posts: 34373
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: How to display VM properties

Postby ferenczy » 28. May 2014, 14:52

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   Expand viewCollapse view
<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   Expand viewCollapse view
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   Expand viewCollapse view
VBoxManage showvminfo "VM name" --natdnsproxy1
Dawid Ferenczy
ferenczy
 
Posts: 6
Joined: 7. Feb 2014, 21:26
Location: Prague, Czech republic
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Linux (Debian, Ubuntu)

Re: How to display VM properties

Postby Qtax » 2. Sep 2019, 14:22

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?
Qtax
 
Posts: 2
Joined: 8. Jun 2016, 09:47

Re: How to display VM properties

Postby scottgus1 » 2. Sep 2019, 14:42

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   Expand viewCollapse view
        <Adapter slot="0" enabled="true" MACAddress="08002750CB2D" type="Am79C973">
          <NAT/>
        </Adapter>

This is with a commanded NAT:
Code: Select all   Expand viewCollapse view
        <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   Expand viewCollapse view
        <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.
Human government is like that crazy uncle who hides a quarter in his fist behind his back, then asks you to guess which fist the quarter is in...
No matter which side you choose, Left or Right, both Sides are empty.
scottgus1
Volunteer
 
Posts: 4488
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Win7


Return to VirtualBox on Windows Hosts

Who is online

Users browsing this forum: No registered users and 51 guests