VirtualBox

Opened 14 years ago

Closed 14 years ago

#6176 closed defect (fixed)

Unable to change IP range of NAT network => Fixed in SVN

Reported by: thin_aire Owned by:
Component: network/NAT Version: VirtualBox 3.1.2
Keywords: Cc:
Guest type: Linux Host type: Windows

Description

Hi

10.0.2.x currrently overlaps my work subnet. I would like to set the IP subnet to 172.23.24/24 but the step listed in the User Manual seem to have no effect. This is the command I am issuing to change the the subnet:

VBoxManage.exe modifyvm OpenSuse01 --natnet1 "172.23.24/24"

If I look in OpenSuse01.xml the first NIC shows: <Adapter slot="0" enabled="true" MACAddress="0800272F1D1A" cable="true" speed="0" type="Am79C973"> <NAT network="172.23.24/24"/>

I also have UseHostResolver set: <ExtraDataItem name="VBoxInternal/Devices/pcnet/0/LUN#0/Config/UseHostResolver" value="1"/>

If I powerdown the VM network="172.23.24/24" goes away.

Posted in Windows Host Forum also: http://forums.virtualbox.org/viewtopic.php?f=6&t=27801

Attachments (1)

vboxlogs.tgz (13.5 KB ) - added by Netpappy 14 years ago.

Download all attachments as: .zip

Change History (11)

comment:1 by Dan Johansson, 14 years ago

I have exactly the same problem. After setting the NAT address to 192.168.200.0/8 the guest host still gets an 10.0.2.15 address and after the guest is shutdown the entry in <host>.xml is missing. I have attached the logfile from my last test. -- Dan

comment:2 by Netpappy, 14 years ago

I have the same problem. I have a subnet at work that is in the 10.0.2, so I need to change to a different network. I am running vbox with the latest release on a Fedora 12 system.

Here are the steps I took, and I will attach log files...

  • Copied my Work-Laptop.xml file to Before_Change_Work-Laptop.xml
  • Made the following change --> VBoxManage modifyvm "Work-Laptop" --natnet1 "172.23.100/24"
  • Copied my Work-Laptop.xml file to After_Change_Work-Laptop.xml
  • Booted the WinXP VM and did an ipconfig /all --> IP Address was: 10.0.2.15/24
  • Tried a DHCP Release and Renew --> IP Address renewed to: 10.0.2.15/24
  • Verified that the Work-Laptop.xml file still had the right NAT information --> <NAT network="172.23.100/24"/>
  • Shut Down the Windows VM
  • Verified that the Work-Laptop.xml file still had the right NAT information --> It was blank
  • Copied Work-Laptop.xml file to After_Boot-ShutDown_Work-Laptop.xml

File Attachment - vboxlogs.tgz

  • 3 XML Files based on descriptions above
  • VBox.log

Let me know if you need anything else...

Thanks, --Joe

by Netpappy, 14 years ago

Attachment: vboxlogs.tgz added

comment:3 by Frank Mehnert, 14 years ago

Summary: Unable to change IP range of NAT network on Windows XP HostUnable to change IP range of NAT network => Fixed in SVN/3.1.6

Confirmed. This is a 3.1.0 regression. The NAT network setting was not properly stored. This bug will be fixed in VBox 3.1.6.

In the meantime there is a workaround: Do

VBoxManage setextradata VM_NAME \
  "VBoxInternal/Devices/pcnet/0/LUN#0/Config/Network" \
  "172.23.24/24"

where you replace VM_NAME with the name of your VM. If you are using an E1000 device (as your log files show) then replace pcnet by e1000. If this is not your first network card, replace /0/ with the proper number. See section 6.3.1 in the user manual -- there we explain how to hack another NAT setting.

comment:4 by Frank Mehnert, 14 years ago

Resolution: fixed
Status: newclosed

comment:5 by Michael Cramer, 14 years ago

Resolution: fixed
Status: closedreopened

I just want to put forth that I am running 3.2.6 and this bug is _NOT_ fixed. The hack provided here does work, however.

in reply to:  5 comment:6 by vasily Levchenko, 14 years ago

Replying to mjcramer:

I just want to put forth that I am running 3.2.6 and this bug is _NOT_ fixed. The hack provided here does work, however.

Could you please describe what are you doing and attach log file to ticket?

comment:7 by Mario, 14 years ago

I can confirm this regression in 3.2.6 and, more specifically, in version "1.10-linux" of the VirtualBox-settings xml file. It worked in version "1.9-linux".

Steps to reproduce:

  1. Start with a "1.9-linux" xml file.
  2. Execute
    $ VBoxManage modifyvm "My VM" --natnet1 "192.168/16"
    
    Xml file still in version "1.9-linux" and working:
    <VirtualBox xmlns="http://www.innotek.de/VirtualBox-settings" version="1.9-linux">
    ...
    <Adapter slot="0" enabled="true" MACAddress="0800273D67AD" cable="true" speed="0" type="Am79C973">
      <NAT network="192.168/16"/>
    </Adapter>
    
  3. Execute
    $ VBoxManage modifyvm "My VM" --natpf1 "myrule,tcp,,57100,,57772"
    
    Xml file automatically upgraded to version "1.10-linux" and, as you can see, our setting is no longer present in the file:
    <VirtualBox xmlns="http://www.innotek.de/VirtualBox-settings" version="1.10-linux">
    ...
    <Adapter slot="0" enabled="true" MACAddress="0800273D67AD" cable="true" speed="0" type="Am79C973">
      <NAT>
        <DNS pass-domain="true" use-proxy="false" use-host-resolver="false"/>
        <Alias logging="false" proxy-only="false" use-same-ports="false"/>
        <Forwarding name="isccache-web" proto="1" hostport="57100" guestport="57772"/>
      </NAT>
    </Adapter>
    

comment:8 by Frank Mehnert, 14 years ago

Summary: Unable to change IP range of NAT network => Fixed in SVN/3.1.6Unable to change IP range of NAT network => Fixed in SVN

Confirmed. Thank you for these findings! The bug will be fixed in the next maintenance release.

in reply to:  8 comment:9 by Mario, 14 years ago

Replying to frank:

Confirmed. Thank you for these findings! The bug will be fixed in the next maintenance release.

You're welcome :)

Until them, others like me that needs NAT & port forwarding can use this script:

#!/bin/bash

VBOX_VM_NAME=$1
VBOX_NAT_RULENAME=$2
VBOX_NAT_PROTO=$3
VBOX_NAT_HOSTPORT=$4
VBOX_NAT_GUESTPORT=$5

echo "Virtual machine name  : $VBOX_VM_NAME"
echo "NAT rule name         : $VBOX_NAT_RULENAME"
echo "NAT protocol (tcp|udp): $VBOX_NAT_PROTO"
echo "NAT host port         : $VBOX_NAT_HOSTPORT"
echo "NAT guest port        : $VBOX_NAT_GUESTPORT"
echo ""

# Ask user for confirmation.
read -p "Are you sure? [y/N] " -e ans
if [ "${ans}" = "y" -o "${ans}" = "Y" ]
then
  #VBoxManage modifyvm "$VBOX_VM_NAME" --natpf1 "$VBOX_NAT_RULENAME,$VBOX_NAT_PROTO,,$VBOX_NAT_HOSTPORT,,$VBOX_NAT_GUESTPORT"
  VBoxManage setextradata "$VBOX_VM_NAME" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/$VBOX_NAT_RULENAME/HostPort"  $VBOX_NAT_HOSTPORT
  VBoxManage setextradata "$VBOX_VM_NAME" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/$VBOX_NAT_RULENAME/GuestPort" $VBOX_NAT_GUESTPORT
  VBoxManage setextradata "$VBOX_VM_NAME" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/$VBOX_NAT_RULENAME/Protocol"  $VBOX_NAT_PROTO
fi

Using "VBoxManage setextradata" don't upgrade xml file version.

IMPORTANT: Remember to stay on version "1.9-linux" of the xml file.

comment:10 by Frank Mehnert, 14 years ago

Resolution: fixed
Status: reopenedclosed

Fixed in VBox 3.2.8.

Note: See TracTickets for help on using tickets.

© 2023 Oracle
ContactPrivacy policyTerms of Use