[Solved] VBoxManage modifyvm <VM NAME> --nataliasmode1 proxyonly not working?

This is for discussing general topics about how to use VirtualBox.
Post Reply
t4$
Posts: 3
Joined: 20. Aug 2019, 21:02

[Solved] VBoxManage modifyvm <VM NAME> --nataliasmode1 proxyonly not working?

Post by t4$ »

Hey folks,

I'm trying to use VBoxManage modifyvm <VM NAME> --nataliasmode1 proxyonly, but it's not working.
I'm using 6.0.10_SUSEr132055 version with same version guest additions.

So using this command on a running vm returns an error and on a powered off vm returns nothing.
I guess using it on a powered off vm is the way to go.
However I'm not sure if guest additions (which I have) or extension-pack (which I don't have) has anything to do with the fact that the command is not working.
I can't even find any entry which confirms that the command was applied or not.

So three questions:
1.) Is there a way to verify that the command is accepted and applied?
2.) Is --nataliasmode1 proxyonly not working with my version of vbox?
3.) Am I doing something wrong?

Thanx a lot for any help.

greetz
t4$
Last edited by socratis on 27. Aug 2019, 10:32, edited 1 time in total.
Reason: Marked as [Solved].
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: VBoxManage modifyvm <VM NAME> --nataliasmode1 proxyonly not working?

Post by socratis »

t4$ wrote:I'm using 6.0.10_SUSEr132055 version with same version guest additions.
It looks like you're using the distro's fork version of VirtualBox. You can either ask in their forums/channels for help, or completely remove/uninstall/delete/purge their version and install the official version from the Linux Downloads section of VirtualBox.
t4$ wrote:I'm trying to use VBoxManage modifyvm <VM NAME> ...
t4$ wrote:So using this command on a running vm returns an error and on a powered off vm returns nothing
The "modifyvm" operates on non-running, non-paused, non-saved state VMs, i.e. only in VMs that are completely shutdown. If the command is indeed successful, then it returns nothing. You only get an output if you get an error.
t4$ wrote:However I'm not sure if guest additions (which I have) or extension-pack (which I don't have) has anything to do with the fact that the command is not working.
Neither the ExtPack, nor the Guest Additions (GAs) have anything to do with this command. And I'm not sure why you think that the command is not working. As I mentioned if the command returns nothing, then it worked.
t4$ wrote:I can't even find any entry which confirms that the command was applied or not.
1) See above, 2) The evidence will be present in the "<VM>.vbox" file.
t4$ wrote:1.) Is there a way to verify that the command is accepted and applied?
If the command returns no error, then it is accepted.
t4$ wrote:2.) Is --nataliasmode1 proxyonly not working with my version of vbox?
Do you have any evidence for that?
t4$ wrote:3.) Am I doing something wrong?
Only if you're trying to use the "VBoxManage modifyvm" command on a running VM.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
t4$
Posts: 3
Joined: 20. Aug 2019, 21:02

Re: VBoxManage modifyvm <VM NAME> --nataliasmode1 proxyonly not working?

Post by t4$ »

Geia sou socratis,

first of all, thank u for ur reply.
socratis wrote:It looks like you're using the distro's fork version of VirtualBox. You can either ask in their forums/channels for help, or completely remove/uninstall/delete/purge their version and install the official version from the 'Linux Downloads' section of VirtualBox.
Alright, before I go on to uninstall the fork version and installing the original, I just want to make sure I understand everything adequately.
socratis wrote:The evidence will be present in the "<VM>.vbox" file.
Very nice, thx. Seems like the command was applied.
A)

Code: Select all

<Network>
<Adapter slot="0" enabled="true" MACAddress="080027BB31F8" promiscuousModePolicy="AllowAll" type="82540EM">
<DisabledModes>
<BridgedInterface name="wlan1"/>
<InternalNetwork name="intnet"/>
<NATNetwork name="NatNetwork"/>
</DisabledModes><NAT>
<Alias proxy-only="true"/>
<Forwarding name="Rule 1" proto="1" hostport="8080" guestport="80"/>
<Forwarding name="Rule 2" proto="1" hostport="1337" guestport="22"/>
</NAT>
</Adapter>
</Network>
socratis wrote:
t4$ wrote:2.) Is --nataliasmode1 proxyonly not working with my version of vbox?
Do you have any evidence for that?
Well, if proxyonly-mode is supposed to make the nat-adapter not alter the source ip, than it is not working with this forked version as it is enabled as stated in A).
Because I have a testing wordpress setup and the server logs give me:

Code: Select all

wordpress_1  | 10.0.2.2 - - [21/Aug/2019:10:22:49 +0000] "GET / HTP* /1.1" 302 402 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0"
Where 10.0.2.2 is not the original requesting IP but an altered IP from the nat(-proxy?).
And it is always 10.0.2.2 no matter which device makes the request.

So if I understand it right, proxyonly-mode is enabled, however not working, so the only thing left to do is to uninstall the forked version and try out the original one, right?

thx/euxaristo :)

PS:
*Had to remove a "T" from HTP or I would get an "You must be a member for 1 days and have 1 posts before you can post urls."-Error.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: VBoxManage modifyvm <VM NAME> --nataliasmode1 proxyonly not working?

Post by socratis »

I'll be honest, I haven't tried the "--nataliasmode1 proxyonly" option, and moreover I don't know what it's supposed to do, or not to do. But reading ch. 9.10.7 Configuring Aliasing of the NAT Engine, I don't see any mention about IP addresses, only ports.
t4$ wrote:Where 10.0.2.2 is not the original requesting IP but an altered IP from the nat(-proxy?).
No, that's the NAT default Gateway/DHCP server.
t4$ wrote:And it is always 10.0.2.2 no matter which device makes the request.
From the bits and pieces of your post it seems that you have multiple VMs that are making requests to a WordPress server. Correct me if I'm wrong, or even better describe your setup in full detail. If you're using multiple VMs to make the requests then for NAT mode, each and every VM will have a 10.0.2.15[1] IP and a 10.0.2.2 gateway/DHCP server. I don't think you can distinguish them like that.

You could try the NATservice (aka NATnetwork) mode which would give each VM a distinct IP, but I'm still not sure if you would see anything else other than the Gateway's IP address in your WordPress logs. From the little searching (and my understanding) what I think you need is what's called "NAT transparent mode", and I'm not sure that VirtualBox has something like that available.

Another option would be to make a VM that "hosts" your WordPress server and make it a part of the NATservice network. Then you would definitely will be able to see which VM makes the request, since all of the VMs and your WordPress server would be on the same network and there would be no need for the NAT. Same would be true if you were to use the Internal network.

[1]: That is true if the NAT mode is used for NIC #1. If you use NAT for the 2nd NIC, the address will be 10.0.3.15 (gateway 10.0.3.2), for the 3rd NIC 10.0.4.15 (gateway 10.0.4.2) and 10.0.5.15 (gateway 10.0.5.2) for the 4th NIC.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
t4$
Posts: 3
Joined: 20. Aug 2019, 21:02

Re: VBoxManage modifyvm <VM NAME> --nataliasmode1 proxyonly not working?

Post by t4$ »

Socratis, my friend, good news….
nataliasmode proxyonly is working and it is able to forward the source IP from the requesting device to the VM.
After spending a lot of time and trying out a lot of things like installing the original version of vbox or trying out NATservice (NATnetwork), I found out how to achieve getting the requesting IP in the wordpress log rather than logging the IP of the NATs default gateway.

The problem was that I didn't specify the source and destination IPs in the NAT portforwarding configuration, I only specified the host-dst port and the guest-dst port to forward to, in order to forward all requests on all interfaces so I don't have to change the host or guest IP if either of the interfaces gets a different IP.
A.)
If [img] tag doesn't work, here are the urls to the image:
https://i.ibb.co/NpHjWLF/vbox.jpg
https://i.imgur.com/hBfvRpK.jpg
+-----------------------------------------------------------------------------+
|                              Port Forwarding Rules                          |
+----------+------------+-----------+------------+-------------+--------------+
|  Name    |  Protocol  |  Host IP  |  HostPort  |  Guest IP   |  Guest Port  |
+----------+------------+-----------+------------+-------------+--------------+
|  Rule 1  |  TCP       |  0.0.0.0  |  8080      |  10.0.2.15  |  80          |
|  Rule 2  |  TCP       |           |  7722      |             |  22          |
+----------+------------+-----------+------------+-------------+--------------+
I had everything configured like described above like in Rule 2 without IPs set only ports.
When I changed this and set the IPs too, like in Rule 1 nataliasmode worked as expected :)

So thanks a lot for your help socratis, and hopefully this helps someone out there saving him/her a lot of time.
Put this one on [solved] :D
greetz t4$
Last edited by socratis on 27. Aug 2019, 10:06, edited 1 time in total.
Reason: Replaced attachment with actual text. Be more "green".
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: VBoxManage modifyvm <VM NAME> --nataliasmode1 proxyonly not working?

Post by socratis »

I replaced your links with an ASCII-pic, hope you don't mind, it's easier if things are online, not too many people will visit 3rd party sites.

Glad you got it going, marking as [Solved]. But I'm still not sure how you're actually distinguishing the guest IPs logged to the server, because all your VMs are going to have a 10.0.2.15 IP...
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Post Reply