NAT interface is always eth0

Discussions about using Linux guests in VirtualBox.
Post Reply
lp
Posts: 6
Joined: 14. Jun 2016, 22:25

NAT interface is always eth0

Post by lp »

Im trying to run CentOS 7 as a guest with 2 host only adapter and 1 NAT interface.

I've set Host-only Adapter 1,2 as adapter #1 and #2 respectively and NAT adapter as adapter #3. Everything working fine but I see that NAT interface is always taking the first interface, i.e. eth0. Is there a way to change NAT interface to eth3?
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: NAT interface is always eth0

Post by Perryg »

From the hosts terminal/command window type VBoxManage showvminfo <VM Name> --details and post here. Replace <VM Name> with the actual name of the VM. Use " " if the name has a space in it.

Note if the host is Windows you need to be in the directory that has VBoxManage.exe for the command to work.
lp
Posts: 6
Joined: 14. Jun 2016, 22:25

Re: NAT interface is always eth0

Post by lp »

Please see below details.

Code: Select all

MacBook-Pro:MacOS unni$ VBoxManage showvminfo ostack_server1 --details
Name:            ostack_server1
Groups:          /New group
Guest OS:        Red Hat (64-bit)
UUID:            a219d33d-accc-4876-bba5-101c8445bbf7
Config file:     /Users/unni/VirtualBox VMs/New group/ostack_server1/ostack_server1.vbox
Snapshot folder: /Users/unni/VirtualBox VMs/New group/ostack_server1/Snapshots
Log folder:      /Users/unni/VirtualBox VMs/New group/ostack_server1/Logs
Hardware UUID:   a219d33d-accc-4876-bba5-101c8445bbf7
Memory size:     4096MB
Page Fusion:     off
VRAM size:       12MB
CPU exec cap:    100%
HPET:            off
Chipset:         piix3
Firmware:        BIOS
Number of CPUs:  1
PAE:             on
Long Mode:       on
CPUID Portability Level: 0
CPUID overrides: None
Boot menu mode:  message and menu
Boot Device (1): Floppy
Boot Device (2): DVD
Boot Device (3): HardDisk
Boot Device (4): Not Assigned
ACPI:            on
IOAPIC:          on
Time offset:     0ms
RTC:             UTC
Hardw. virt.ext: on
Nested Paging:   on
Large Pages:     on
VT-x VPID:       on
VT-x unr. exec.: on
Paravirt. Provider: Default
State:           running (since 2016-06-15T01:07:03.584000000)
Monitor count:   1
3D Acceleration: off
2D Video Acceleration: off
Teleporter Enabled: off
Teleporter Port: 0
Teleporter Address: 
Teleporter Password: 
Tracing Enabled: off
Allow Tracing to Access VM: off
Tracing Configuration: 
Autostart Enabled: off
Autostart Delay: 0
Default Frontend: 
Storage Controller Name (0):            IDE
Storage Controller Type (0):            PIIX4
Storage Controller Instance Number (0): 0
Storage Controller Max Port Count (0):  2
Storage Controller Port Count (0):      2
Storage Controller Bootable (0):        on
Storage Controller Name (1):            SATA
Storage Controller Type (1):            IntelAhci
Storage Controller Instance Number (1): 0
Storage Controller Max Port Count (1):  30
Storage Controller Port Count (1):      1
Storage Controller Bootable (1):        on
IDE (1, 0): Empty (ejected)
SATA (0, 0): /Volumes/DATA/ostack_server1.vdi (UUID: 77a454ca-fec6-48a4-8285-6f197cd2b5f8)
NIC 1:           MAC: 080027AE8A03, Attachment: Host-only Interface 'vboxnet0', Cable connected: on, Trace: off (file: none), Type: virtio, Reported speed: 0 Mbps, Boot priority: 0, Promisc Policy: allow-all, Bandwidth group: none
NIC 2:           MAC: 0800277BA1CF, Attachment: Host-only Interface 'vboxnet1', Cable connected: on, Trace: off (file: none), Type: virtio, Reported speed: 0 Mbps, Boot priority: 0, Promisc Policy: allow-all, Bandwidth group: none
NIC 3:           MAC: 080027CFEB34, Attachment: NAT, Cable connected: on, Trace: off (file: none), Type: 82540EM, Reported speed: 0 Mbps, Boot priority: 0, Promisc Policy: allow-all, Bandwidth group: none
NIC 3 Settings:  MTU: 0, Socket (send: 64, receive: 64), TCP Window (send:64, receive: 64)
NIC 4:           disabled
NIC 5:           disabled
NIC 6:           disabled
NIC 7:           disabled
NIC 8:           disabled
Pointing Device: PS/2 Mouse
Keyboard Device: PS/2 Keyboard
UART 1:          disabled
UART 2:          disabled
UART 3:          disabled
UART 4:          disabled
LPT 1:           disabled
LPT 2:           disabled
Audio:           enabled (Driver: CoreAudio, Controller: AC97, Codec: AD1980)
Clipboard Mode:  disabled
Drag and drop Mode: disabled
Session name:    GUI/Qt
Video mode:      720x400x0 at 0,0 enabled
VRDE:            disabled
USB:             enabled
EHCI:            disabled
XHCI:            disabled

USB Device Filters:

<none>

Available remote USB devices:

<none>

Currently Attached USB Devices:

<none>

Bandwidth groups:  <none>

Shared folders:  <none>

VRDE Connection:    not active
Clients so far:     0

Video capturing:    not active
Capture screens:    0
Capture file:       /Users/unni/VirtualBox VMs/New group/ostack_server1/ostack_server1.webm
Capture dimensions: 1024x768
Capture rate:       512 kbps
Capture FPS:        25

Guest:

Configured memory balloon size:      0 MB
OS type:                             RedHat_64
Additions run level:                 0

Guest Facilities:

No active facilities.


MacBook-Pro:MacOS unni$
Last edited by lp on 15. Jun 2016, 03:21, edited 1 time in total.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: NAT interface is always eth0

Post by Perryg »

Strange you posted in a Linux as host section but it looks like you are running Mac. Is this correct?

I also imagine that you were not root when you created guest, but I need you to confirm that as well.
lp
Posts: 6
Joined: 14. Jun 2016, 22:25

Re: NAT interface is always eth0

Post by lp »

Sorry for that. I'm running a Linux guest on a Mac host. Could you please move this topic to Mac section if you don't mind.

BTW, below is what you have asked.

Code: Select all

MacBook-Pro:MacOS unni$ VBoxManage showvminfo ostack_server1 --details
Name:            ostack_server1
Groups:          /New group
Guest OS:        Red Hat (64-bit)
UUID:            a219d33d-accc-4876-bba5-101c8445bbf7
Config file:     /Users/unni/VirtualBox VMs/New group/ostack_server1/ostack_server1.vbox
Snapshot folder: /Users/unni/VirtualBox VMs/New group/ostack_server1/Snapshots
Log folder:      /Users/unni/VirtualBox VMs/New group/ostack_server1/Logs
Hardware UUID:   a219d33d-accc-4876-bba5-101c8445bbf7
Memory size:     4096MB
Page Fusion:     off
VRAM size:       12MB
CPU exec cap:    100%
HPET:            off
Chipset:         piix3
Firmware:        BIOS
Number of CPUs:  1
PAE:             on
Long Mode:       on
CPUID Portability Level: 0
CPUID overrides: None
Boot menu mode:  message and menu
Boot Device (1): Floppy
Boot Device (2): DVD
Boot Device (3): HardDisk
Boot Device (4): Not Assigned
ACPI:            on
IOAPIC:          on
Time offset:     0ms
RTC:             UTC
Hardw. virt.ext: on
Nested Paging:   on
Large Pages:     on
VT-x VPID:       on
VT-x unr. exec.: on
Paravirt. Provider: Default
State:           running (since 2016-06-15T01:07:03.584000000)
Monitor count:   1
3D Acceleration: off
2D Video Acceleration: off
Teleporter Enabled: off
Teleporter Port: 0
Teleporter Address: 
Teleporter Password: 
Tracing Enabled: off
Allow Tracing to Access VM: off
Tracing Configuration: 
Autostart Enabled: off
Autostart Delay: 0
Default Frontend: 
Storage Controller Name (0):            IDE
Storage Controller Type (0):            PIIX4
Storage Controller Instance Number (0): 0
Storage Controller Max Port Count (0):  2
Storage Controller Port Count (0):      2
Storage Controller Bootable (0):        on
Storage Controller Name (1):            SATA
Storage Controller Type (1):            IntelAhci
Storage Controller Instance Number (1): 0
Storage Controller Max Port Count (1):  30
Storage Controller Port Count (1):      1
Storage Controller Bootable (1):        on
IDE (1, 0): Empty (ejected)
SATA (0, 0): /Volumes/DATA/ostack_server1.vdi (UUID: 77a454ca-fec6-48a4-8285-6f197cd2b5f8)
NIC 1:           MAC: 080027AE8A03, Attachment: Host-only Interface 'vboxnet0', Cable connected: on, Trace: off (file: none), Type: virtio, Reported speed: 0 Mbps, Boot priority: 0, Promisc Policy: allow-all, Bandwidth group: none
NIC 2:           MAC: 0800277BA1CF, Attachment: Host-only Interface 'vboxnet1', Cable connected: on, Trace: off (file: none), Type: virtio, Reported speed: 0 Mbps, Boot priority: 0, Promisc Policy: allow-all, Bandwidth group: none
NIC 3:           MAC: 080027CFEB34, Attachment: NAT, Cable connected: on, Trace: off (file: none), Type: 82540EM, Reported speed: 0 Mbps, Boot priority: 0, Promisc Policy: allow-all, Bandwidth group: none
NIC 3 Settings:  MTU: 0, Socket (send: 64, receive: 64), TCP Window (send:64, receive: 64)
NIC 4:           disabled
NIC 5:           disabled
NIC 6:           disabled
NIC 7:           disabled
NIC 8:           disabled
Pointing Device: PS/2 Mouse
Keyboard Device: PS/2 Keyboard
UART 1:          disabled
UART 2:          disabled
UART 3:          disabled
UART 4:          disabled
LPT 1:           disabled
LPT 2:           disabled
Audio:           enabled (Driver: CoreAudio, Controller: AC97, Codec: AD1980)
Clipboard Mode:  disabled
Drag and drop Mode: disabled
Session name:    GUI/Qt
Video mode:      720x400x0 at 0,0 enabled
VRDE:            disabled
USB:             enabled
EHCI:            disabled
XHCI:            disabled

USB Device Filters:

<none>

Available remote USB devices:

<none>

Currently Attached USB Devices:

<none>

Bandwidth groups:  <none>

Shared folders:  <none>

VRDE Connection:    not active
Clients so far:     0

Video capturing:    not active
Capture screens:    0
Capture file:       /Users/unni/VirtualBox VMs/New group/ostack_server1/ostack_server1.webm
Capture dimensions: 1024x768
Capture rate:       512 kbps
Capture FPS:        25

Guest:

Configured memory balloon size:      0 MB
OS type:                             RedHat_64
Additions run level:                 0

Guest Facilities:

No active facilities.


MacBook-Pro:MacOS unni$
lp
Posts: 6
Joined: 14. Jun 2016, 22:25

Re: NAT interface is always eth0

Post by lp »

i've posted this query in VirtualBox on Mac OSX. Please feel free to delete this thread.

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

Re: NAT interface is always eth0

Post by Perryg »

Well the logical place to place this is Linux Guest then.

Now the proper layout as far as VirtualBox is concerned looks fine so the issue of the eth* name must reside within the guest. It may be as simple as the way you configured the guest at the beginning. Actually the eth* really makes no difference to how the guest runs but if you want to change that you would need to do it within the guest. See the CentOS folks on how you would achieve that.
lp
Posts: 6
Joined: 14. Jun 2016, 22:25

Re: NAT interface is always eth0

Post by lp »

that's right @Perryg. im trying to deploy one application which is specific on eth names.
I'm already searching how define/change device names from OS (centOS 7) side... opened this thread just to confirm it has nothing to do with VB.


Thanks very much for your quick responses.
Post Reply