Page 1 of 1

Need ip from headless bridged vm

Posted: 2. Sep 2020, 15:45
by JoseManuelLasJim
I've created a bridged vm on my PC and now i need to move it to another PC

I exported it as an .ova file and imported on the target pc successfully

The problem i have now is that i can't connect by ssh to my vm because i don't know which ip it has or even if the dhcp gave him one

I've asked the network manager to compare my MAC to his DHCP server in order to know the ip but he can't find the MAC.

I'm really stuck and don't know what else to do, i'll post here some data i've collected.

-- DATA --

[omnitec@localhost /]$ VBoxManage guestproperty get omnitec "/VirtualBox/GuestInfo/Net/0/V4/IP"
No value set!

[omnitec@localhost /]$ ifconfig
eno16780032: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 100.64.100.64 netmask 255.255.0.0 broadcast 100.64.255.255
inet6 fe80::20c:29ff:fe4d:7bca prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:4d:7b:ca txqueuelen 1000 (Ethernet)
RX packets 255922 bytes 28460672 (27.1 MiB)
RX errors 0 dropped 69 overruns 0 frame 0
TX packets 3126 bytes 132600 (129.4 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

eno33559296: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.16.126 netmask 255.255.252.0 broadcast 192.168.19.255
inet6 fe80::20c:29ff:fe4d:7bd4 prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:4d:7b:d4 txqueuelen 1000 (Ethernet)
RX packets 4762708 bytes 612322787 (583.9 MiB)
RX errors 0 dropped 2349825 overruns 0 frame 0
TX packets 7813 bytes 448714 (438.1 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

eno50338560: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.255.15.50 netmask 255.255.255.0 broadcast 10.255.15.255
inet6 fe80::20c:29ff:fe4d:7bde prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:4d:7b:de txqueuelen 1000 (Ethernet)
RX packets 5995466 bytes 8910168746 (8.2 GiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 3417231 bytes 243028417 (231.7 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 3662 bytes 322164 (314.6 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 3662 bytes 322164 (314.6 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

[omnitec@localhost /]$ vboxmanage list bridgedifs
Name: eno50338560
GUID: 356f6e65-3330-4833-b536-000c294d7bde
DHCP: Disabled
IPAddress: 10.255.15.50
NetworkMask: 255.255.255.0
IPV6Address: fe80::20c:29ff:fe4d:7bde
IPV6NetworkMaskPrefixLength: 64
HardwareAddress: 00:0c:29:4d:7b:de
MediumType: Ethernet
Wireless: No
Status: Up
VBoxNetworkName: HostInterfaceNetworking-eno50338560

Name: eno33559296
GUID: 336f6e65-3533-4935-b239-000c294d7bd4
DHCP: Disabled
IPAddress: 192.168.16.126
NetworkMask: 255.255.252.0
IPV6Address: fe80::20c:29ff:fe4d:7bd4
IPV6NetworkMaskPrefixLength: 64
HardwareAddress: 00:0c:29:4d:7b:d4
MediumType: Ethernet
Wireless: No
Status: Up
VBoxNetworkName: HostInterfaceNetworking-eno33559296

Name: eno16780032
GUID: 316f6e65-3736-4038-b033-000c294d7bca
DHCP: Disabled
IPAddress: 100.64.100.64
NetworkMask: 255.255.0.0
IPV6Address: fe80::20c:29ff:fe4d:7bca
IPV6NetworkMaskPrefixLength: 64
HardwareAddress: 00:0c:29:4d:7b:ca
MediumType: Ethernet
Wireless: No
Status: Up
VBoxNetworkName: HostInterfaceNetworking-eno16780032

[omnitec@localhost /]$ VBoxManage showvminfo omnitec
Name: omnitec
Groups: /
Guest OS: Ubuntu (64-bit)
UUID: 7b010b37-3370-41fe-a117-01ecdaa528a1
Config file: /home/omnitec/VirtualBox VMs/omnitec/omnitec.vbox
Snapshot folder: /home/omnitec/VirtualBox VMs/omnitec/Snapshots
Log folder: /home/omnitec/VirtualBox VMs/omnitec/Logs
Hardware UUID: 7b010b37-3370-41fe-a117-01ecdaa528a1
Memory size: 1024MB
Page Fusion: off
VRAM size: 16MB
CPU exec cap: 100%
HPET: off
Chipset: piix3
Firmware: BIOS
Number of CPUs: 1
PAE: off
Long Mode: on
Triple Fault Reset: off
APIC: on
X2APIC: 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
BIOS APIC mode: APIC
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
Effective Paravirt. Provider: KVM
State: running (since 2020-09-02T07:52:01.705000000)
Graphics Controller: VMSVGA
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
SATA (0, 0): /home/omnitec/VirtualBox VMs/omnitec/omnitec-disk001.vmdk (UUID: af593b19-4e72-4235-b16a-eedce7288517)
NIC 1: MAC: 08002726365A, Attachment: Bridged Interface 'eno16780032', Cable connected: on, Trace: off (file: none), Type: 82540EM, Reported speed: 0 Mbps, Boot priority: 0, Promisc Policy: deny, Bandwidth group: none
NIC 2: disabled
NIC 3: disabled
NIC 4: disabled
NIC 5: disabled
NIC 6: disabled
NIC 7: disabled
NIC 8: disabled
Pointing Device: USB Tablet
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: ALSA, Controller: AC97, Codec: AD1980)
Audio playback: enabled
Audio capture: disabled
Clipboard Mode: disabled
Drag and drop Mode: disabled
Session name: headless
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

Capturing: not active
Capture audio: not active
Capture screens: 0
Capture file: /home/omnitec/VirtualBox VMs/omnitec
Capture dimensions: 1024x768
Capture rate: 512 kbps
Capture FPS: 25
Capture options:

Guest:

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

Guest Facilities:

No active facilities.


[omnitec@localhost /]$ VBoxManage list dhcpservers
NetworkName: HostInterfaceNetworking-vboxnet0
IP: 192.168.56.100
NetworkMask: 255.255.255.0
lowerIPAddress: 192.168.56.101
upperIPAddress: 192.168.56.254
Enabled: Yes

[omnitec@localhost /]$ VBoxManage guestproperty enumerate omnitec
Name: /VirtualBox/HostInfo/GUI/LanguageID, value: es_ES, timestamp: 1598991179913574000, flags: RDONLYGUEST
Name: /VirtualBox/HostInfo/VBoxVerExt, value: 5.2.44, timestamp: 1599033121574806000, flags: TRANSIENT, RDONLYGUEST
Name: /VirtualBox/HostGuest/SysprepExec, value: , timestamp: 1599033121574532000, flags: TRANSIENT, RDONLYGUEST
Name: /VirtualBox/HostInfo/DekMissing, value: 1, timestamp: 1598982069129225800, flags: RDONLYGUEST
Name: /VirtualBox/HostGuest/SysprepArgs, value: , timestamp: 1599033121574573000, flags: TRANSIENT, RDONLYGUEST
Name: /VirtualBox/HostInfo/VBoxRev, value: 139111, timestamp: 1599033121574834000, flags: TRANSIENT, RDONLYGUEST
Name: /VirtualBox/HostInfo/VBoxVer, value: 5.2.44, timestamp: 1599033121574777000, flags: TRANSIENT, RDONLYGUEST
[omnitec@localhost /]$

[omnitec@localhost /]$ vboxmanage list bridgedifs
Name: eno50338560
GUID: 356f6e65-3330-4833-b536-000c294d7bde
DHCP: Disabled
IPAddress: 10.255.15.50
NetworkMask: 255.255.255.0
IPV6Address: fe80::20c:29ff:fe4d:7bde
IPV6NetworkMaskPrefixLength: 64
HardwareAddress: 00:0c:29:4d:7b:de
MediumType: Ethernet
Wireless: No
Status: Up
VBoxNetworkName: HostInterfaceNetworking-eno50338560

Name: eno33559296
GUID: 336f6e65-3533-4935-b239-000c294d7bd4
DHCP: Disabled
IPAddress: 192.168.16.126
NetworkMask: 255.255.252.0
IPV6Address: fe80::20c:29ff:fe4d:7bd4
IPV6NetworkMaskPrefixLength: 64
HardwareAddress: 00:0c:29:4d:7b:d4
MediumType: Ethernet
Wireless: No
Status: Up
VBoxNetworkName: HostInterfaceNetworking-eno33559296

Name: eno16780032
GUID: 316f6e65-3736-4038-b033-000c294d7bca
DHCP: Disabled
IPAddress: 100.64.100.64
NetworkMask: 255.255.0.0
IPV6Address: fe80::20c:29ff:fe4d:7bca
IPV6NetworkMaskPrefixLength: 64
HardwareAddress: 00:0c:29:4d:7b:ca
MediumType: Ethernet
Wireless: No
Status: Up
VBoxNetworkName: HostInterfaceNetworking-eno16780032

Re: Need ip from headless bridged vm

Posted: 2. Sep 2020, 20:54
by scottgus1
JoseManuelLasJim wrote:I've created a bridged vm on my PC and now i need to move it to another PC

I exported it as an .ova file and imported on the target pc successfully
A Bridged guest gets its IP address from the LAN, and a DHCP-served IP address depends on the MAC address. Exporting changes the MAC address (or it defaults to do so I think). Merely copying the guest folder and all guest disks stored elsewhere, if any (see Moving a VM), leaves the MAC address the same, and if you aren't running your existing guest at the time the copied guest should get the same IP address from the LAN.

Another way to get into the guest is to just start it on the other PC and use it there until you get the IP address, or set the guest to allow Virtualbox Remote Desktop. Either way you get to see the desktop of the guest OS and see the IP address.

VBoxManage guestproperty get omnitec "/VirtualBox/GuestInfo/Net/0/V4/IP" requires Guest Additions to be running in the guest OS.

Also, the guest needs to Bridge to an existing Ethernet card on the new host. You have to choose the Ethernet card manually.

Re: Need ip from headless bridged vm

Posted: 3. Sep 2020, 09:50
by JoseManuelLasJim
First of all thank you for the fast reply

A Bridged guest gets its IP address from the LAN, and a DHCP-served IP address depends on the MAC address. Exporting changes the MAC address (or it defaults to do so I think). Merely copying the guest folder and all guest disks stored elsewhere, if any (see Moving a VM), leaves the MAC address the same, and if you aren't running your existing guest at the time the copied guest should get the same IP address from the LAN.
-> I have exported the mv resetting all the MAC, so the MAC of the copy is different of the original one
-> My original VM is on my country and the copy is on another country , and of course completely different network , and i'm not the manager of that network, i only can ask for specific actions to the manager.

Set the guest to allow Virtualbox Remote Desktop. Either way you get to see the desktop of the guest OS and see the IP address.
-> I tried to do this but the host is headless and VRDE needs graphical environment. If i install graphical env on the host, will be possible with this VRD to connect with only the VRDE port and the ip of the bridged host interface?

Also, the guest needs to Bridge to an existing Ethernet card on the new host. You have to choose the Ethernet card manually.
-> It is bridged to an existing interface and changed already

Re: Need ip from headless bridged vm

Posted: 3. Sep 2020, 17:10
by scottgus1
JoseManuelLasJim wrote:My original VM is on my country and the copy is on another country
That's is an important part of the story. The first post didn't mention this.
I guess that unless you and the other host are 10 feet each side of the border, this would be a long commute. :lol: So no going to the other host, understood.
JoseManuelLasJim wrote:completely different network
Your new guest's location is across the internet now, and in a new network, so you would no longer use the guest's Bridged LAN IP address like you were doing when the guest ran on your PC. The internet and the other location's firewall and router are in the way.

The network manager at the other location needs to access the guest in the new location, get its Bridged IP address, then open that IP address and required ports onto the internet. You would then access the guest with the other.LAN.public.IPaddress:portnumber. (Remote desktop will require open ports on the internet, too, so VRDE won't help.)

I have installed Logmein Hamachi, a per-to-peer VPN, on a guest I gave to another company with a different LAN, so I could get into my guest without opening ports or IP address in the new location's router. Perhaps you could put something similar in your guest so you can get in more easily.

Re: Need ip from headless bridged vm

Posted: 11. Sep 2020, 10:14
by JoseManuelLasJim
Sorry for the late reply but looks like the remote network administrator has some problems with it, anyway the idea of installing a vpn "i installed openvpn" was wonderful, now my machine has it installed and working and i'm just waiting a solution from the other network manager.

Thx a lot for your replies I consider this topic closed

Re: Need ip from headless bridged vm

Posted: 11. Sep 2020, 17:45
by scottgus1
Great! Glad you're up and running.