I have a Linux Mint 20 host machine running VirtualBox with Debian 11 (bullseye). NAT connection works fine, but I need a bridged connection for SSH, as the purpose of the virtual machine is to simulate a remote machine in production. Funny thing is, bridged connection was working at first, but then a couple days later it stopped working. This had already happened with other guest OSes, such as CentOS and Manjaro. Even though at the time I did not bother to investigate the root of the problem, I guess it is a good clue to what could be going on (DHCP ?)
In the host machine, I am connected with WLAN (wlp2s0), but as far as I understand, it should be listed as a cabled connection enp0s3 in the guest, right?
What I have tried, to no success:
- Installing "Guest Additions CD" -- not sure it actually worked, I still cannot do birectional clipboard, even though I enabled it
- Changing "adapter type" and "promiscuous mode"
- Changing MAC Address in VirtualBox settings so it matches host's network interface's.
- Creating a bridged network
bridge0in the host and changing network name in VirtualBox fromwlp2s0to it (not sure I really understand this process, maybe something went wrong). - I read through previous possibly related questions, but it did not seem to apply to my case, and I could not understand much of what was technically going on.
Some information:
user@host $ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp1s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN group default qlen 1000
link/ether 98:83:89:c5:26:5b brd ff:ff:ff:ff:ff:ff
3: wlp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 98:83:89:d1:2c:c9 brd ff:ff:ff:ff:ff:ff
inet 192.168.0.14/24 brd 192.168.0.255 scope global dynamic noprefixroute wlp2s0
valid_lft 58283sec preferred_lft 58283sec
inet6 2804:14c:1c2:9309::1002/128 scope global dynamic noprefixroute
valid_lft 533484sec preferred_lft 533484sec
inet6 2804:14c:1c2:9309:9c84:d6fb:1aff:c777/64 scope global temporary dynamic
valid_lft 533485sec preferred_lft 15003sec
inet6 2804:14c:1c2:9309:c861:79dd:1705:f61a/64 scope global dynamic mngtmpaddr noprefixroute
valid_lft 565181sec preferred_lft 478781sec
inet6 fe80::e000:da4:1870:553/64 scope link noprefixroute
valid_lft forever preferred_lft forever
4: bridge0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
link/ether c2:9e:22:d0:ae:bf brd ff:ff:ff:ff:ff:ff
user@guest $ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN group default qlen 1000
link/ether 98:83:89:d1:2c:c9 brd ff:ff:ff:ff:ff:ff
inet6 fe80::9a83:89ff:fed1:2cc9/64 scope link noprefixroute
valid_lft forever preferred_lft forever
user@guest $ lspci
00:00.0 Host bridge: Intel Corporation 440FX - 82441FX PMC [Natoma] (rev 02)
00:01.0 ISA bridge: Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II]
00:01.1 IDE interface: Intel Corporation 82371AB/EB/MB PIIX4 IDE (rev 01)
00:02.0 VGA compatible controller: VMware SVGA II Adapter
00:03.0 Ethernet controller: Advanced Micro Devices, Inc. [AMD] 79c970 [PCnet32 LANCE] (rev 10)
00:04.0 System peripheral: InnoTek Systemberatung GmbH VirtualBox Guest Service
00:05.0 Multimedia audio controller: Intel Corporation 82801AA AC'97 Audio Controller (rev 01)
00:06.0 USB controller: Apple Inc. KeyLargo/Intrepid USB
00:07.0 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 08)
00:0d.0 SATA controller: Intel Corporation 82801HM/HEM (ICH8M/ICH8M-E) SATA Controller [AHCI mode] (rev 02)
So, I see the guest's uname says -amd64, so I thought it could be solved by changing the adapter type to PCNET, which is from AMD (according to link, though is it?). But then, Bridge is listed as Intel. I really don't understand any of this, it has been pretty much trial and error and I would be grateful if somebody could help me understand what is going on.