connection issues Virtualbox Linux Server from MAC Terminal

Discussions related to using VirtualBox on Mac OS X hosts.
Post Reply
Bhavani
Posts: 8
Joined: 10. Jul 2022, 19:41

connection issues Virtualbox Linux Server from MAC Terminal

Post by Bhavani »

I have installed the VirtualBox and configured the OracleLinux 9 Server - However when I try to connect to this new server from MAC Terminal I am running into the below issues-

Bhavanis-MBP:~ bhavanidhulipalla$ ping 192.168.56.107
PING 192.168.56.107 (192.168.56.107): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
^C
--- 192.168.56.107 ping statistics ---
3 packets transmitted, 0 packets received, 100.0% packet loss
Bhavanis-MBP:~ bhavanidhulipalla$

Bhavanis-MBP:~ bhavanidhulipalla$
Bhavanis-MBP:~ bhavanidhulipalla$ ssh root@192.168.56.107
ssh: connect to host 192.168.56.107 port 22: Operation timed out

I attached the screenshot of the network adapter settings on my VirtualBox.

I have disabled the firewall on Linux Server.
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: connection issues Virtualbox Linux Server from MAC Terminal

Post by scottgus1 »

I gather from the IP address that you're attempting to ping that you're trying to use a Host-Only network. Please provide some diagnostic info:
  • The VM's .vbox file: Right-click the VM in the main Virtualbox window's VM list, choose Show in Explorer/Finder/File Manager. Zip the VM's .vbox file (not the .vbox-prev file), and post the zip file, using the forum's Upload Attachment tab. (Configure your host OS to show all extensions if the folder that opens does not show a .vbox file.)
  • The host's and VM's IP info: In the Mac & Linux OSs, open a Terminal and run ifconfig or ip address. Post the command output. Label which is which.
  • On the host terminal, run this command and provide the output:
    vboxmanage list hostonlyifs
  • The VM's log: Start the VM from full normal shutdown, not save-state. Run until you see the problem happen, then shut down the VM from within the VM's OS if possible. If not possible, close the Virtualbox window for the VM with the Power Off option set. Right-click the VM in the main Virtualbox window's VM list, choose Show Log. Save the far left tab's log, zip it, and post the zip file, using the forum's Upload Attachment tab.
Bhavani
Posts: 8
Joined: 10. Jul 2022, 19:41

Re: connection issues Virtualbox Linux Server from MAC Terminal

Post by Bhavani »

Thank you for helping me -

I am attaching the requesting information
Attachments
IP'S_INFO.txt
IPS information from MAC and Virtualbox
(6.05 KiB) Downloaded 6 times
Linux02.vbox.zip
zip file of .vbox
(1.49 KiB) Downloaded 4 times
Bhavani
Posts: 8
Joined: 10. Jul 2022, 19:41

Re: connection issues Virtualbox Linux Server from MAC Terminal

Post by Bhavani »

Here is the Virtualbox log file -
Attachments
Virtualboxlogfile.txt.zip
(32.34 KiB) Downloaded 3 times
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: connection issues Virtualbox Linux Server from MAC Terminal

Post by scottgus1 »

Thanks for all the info! The VM has two active network adapters connected to the same Host-Only network. I'm not certain if this can cause problems, but try simplifying things by turning one adapter off or at least disconnecting the "cable", and run with only one adapter connected to Host-Only.

However, I do see a problem with the IP address of the Host Only adapter on the host:
Bhavanis-MBP:Linux02 bhavanidhulipalla$ vboxmanage list hostonlyifs
Name: vboxnet0
DHCP: Disabled
IPAddress: 10.9.8.1
NetworkMask: 255.255.255.0
Here are the VM's IP addresses:
enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.56.107 netmask 255.255.255.0 broadcast 192.168.56.255

enp0s8: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.56.108 netmask 255.255.255.0 broadcast 192.168.56.255
Because of the netmask blocking changes in the first three octets, 10.9.8.# cannot talk to 192.168.56.#. It seems the host's Host-Only adapter IP address was modified from the default 192.168.56.1, which appears to have broken Host-Only. Try changing that IP address back to the default before starting the VM, then see what you get.
Bhavani
Posts: 8
Joined: 10. Jul 2022, 19:41

Re: connection issues Virtualbox Linux Server from MAC Terminal

Post by Bhavani »

I see my IP address 192.168.1.204.

But SSH is failing and I see SSH Service is active in my server.

Bhavanis-MBP:~ bhavanidhulipalla$ ping 192.168.1.204
PING 192.168.1.204 (192.168.1.204): 56 data bytes
64 bytes from 192.168.1.204: icmp_seq=0 ttl=64 time=0.057 ms
64 bytes from 192.168.1.204: icmp_seq=1 ttl=64 time=0.082 ms
64 bytes from 192.168.1.204: icmp_seq=2 ttl=64 time=0.061 ms

Bhavanis-MBP:~ bhavanidhulipalla$ ssh root@192.168.1.204
ssh: connect to host 192.168.1.204 port 22: Connection refused

[root@Linux02 bhavani]# ifconfig

enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.204 netmask 255.255.255.0 broadcast 192.168.56.255
inet6 fe80::a00:27ff:fee7:2032 prefixlen 64 scopeid 0x20<link>
ether 08:00:27:e7:20:32 txqueuelen 1000 (Ethernet)
RX packets 90 bytes 16134 (15.7 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 42 bytes 4984 (4.8 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: connection issues Virtualbox Linux Server from MAC Terminal

Post by scottgus1 »

From this it appears that you modified the VM's IP address:
Bhavani wrote:I see set(?)my IP address 192.168.1.204.
Bhavani wrote:[root@Linux02 bhavani]# ifconfig

enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.204 netmask 255.255.255.0 broadcast 192.168.56.255
However, this new IP address is the same as the host's 'en0' adapter:
IP'S_INFO.txt wrote:Bhavanis-MBP:Linux02 bhavanidhulipalla$ ifconfig
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=6463<RXCSUM,TXCSUM,TSO4,TSO6,CHANNEL_IO,PARTIAL_CSUM,ZEROINVERT_CSUM>
...
inet 192.168.1.204 netmask 0xffffff00 broadcast 192.168.1.255
If you expected to get the VM to talk to the host by having the VM and host have the same IP address, that's not going to work. Each network adapter in a network needs a unique IP address.

Another problem: The VM's 'enp0s3' adapter is in the Host-Only network, note the still-192.168.56.# broadcast address. the Host-Only adapter does not connect to the host's physical 'en0' adapter. These are two separate networks and cannot talk to each other no matter what IP addresses are set.

The biggest problem:
scottgus1 wrote:Because of the netmask blocking changes in the first three octets, 10.9.8.# cannot talk to 192.168.56.#. It seems the host's Host-Only adapter IP address was modified from the default 192.168.56.1, which appears to have broken Host-Only. Try changing that IP address back to the default before starting the VM, then see what you get.
Trying to change the VM adapter's address was not suggested. Did you read my post? Did you try the suggestion?

Right now this VM and Host-Only network are so pebcaked that you should really delete everything and start over. Delete the VM, delete the Host-Only network, reboot the Mac, make a new Host-Only network. Don't change any IP addresses. Just let Host-Only do what it does. Make a new VM, connected to Host-Only. Get the 192.168.56.# IP address in the VM, and use that IP address to talk to the VM from the host. Use the host's Host-Only IP address 192.168.56.1 to talk to the host from the VM.

Web-search how networks are supposed to work. There were several user errors here that broke the network. To learn how Host-Only works, see Virtualbox Networks: In Pictures: Host-Only Adapter
Bhavani
Posts: 8
Joined: 10. Jul 2022, 19:41

Re: connection issues Virtualbox Linux Server from MAC Terminal

Post by Bhavani »

Thank you so much!

I removed everything and created the new machine with the default addresses now I am able to login.

Bhavanis-MBP:~ bhavanidhulipalla$ ssh root@192.168.56.3
root@192.168.56.3's password:
Activate the web console with: systemctl enable --now cockpit.socket

Last login: Sat Jul 16 21:30:21 2022 from 192.168.56.1
[root@Linuxos ~]# ifconfig
enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.56.3 netmask 255.255.255.0 broadcast 192.168.56.255
inet6 fe80::a00:27ff:fe11:bd2f prefixlen 64 scopeid 0x20<link>
ether 08:00:27:11:bd:2f txqueuelen 1000 (Ethernet)
RX packets 126 bytes 17366 (16.9 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 99 bytes 13308 (12.9 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

enp0s8: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
ether 08:00:27:d4:a3:a6 txqueuelen 1000 (Ethernet)
RX packets 7 bytes 1092 (1.0 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
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 262 bytes 21535 (21.0 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 262 bytes 21535 (21.0 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

now to finish setting up the configuration , I need to enable the internet access for my virtual machine -

I enabled the bridged adapter and tried with all network adapter and it's not working .
[root@Linuxos ~]#
[root@Linuxos ~]# yum install python
Oracle Linux 9 BaseOS Latest (x86_64) 0.0 B/s | 0 B 00:00
Errors during downloading metadata for repository 'ol9_baseos_latest':
- Curl error (6): Couldn't resolve host name for https://yum.oracle.com/repo/OracleLinux ... repomd.xml [Could not resolve host: yum.oracle.com]
Error: Failed to download metadata for repo 'ol9_baseos_latest': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
[root@Linuxos ~]#

Attached Image contains my settings.
Attachments
Screen Shot 2022-07-17 at 1.23.12 PM copy.png
Screen Shot 2022-07-17 at 1.23.12 PM copy.png (96.57 KiB) Viewed 5101 times
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: connection issues Virtualbox Linux Server from MAC Terminal

Post by scottgus1 »

From this it appears yhat you have a working Host-Only network, great!
Bhavani wrote:Bhavanis-MBP:~ bhavanidhulipalla$ ssh root@192.168.56.3
root@192.168.56.3's password:
Activate the web console with: systemctl enable --now cockpit.socket

Last login: Sat Jul 16 21:30:21 2022 from 192.168.56.1
[root@Linuxos ~]# ifconfig
enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.56.3 netmask 255.255.255.0 broadcast 192.168.56.255
You have a second adapter in the VM:
Bhavani wrote:enp0s8: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
which according to the screenshot appears to be Bridged to Wi-Fi.

Bridged does not always work on Wi-fi, see Virtualbox Networks: In Pictures: Bridged Adapter, and the VM's enp0s8 is not getting an IP address.

Set the second adapter to NAT. Then internet should get into the VM.
Bhavani
Posts: 8
Joined: 10. Jul 2022, 19:41

Re: connection issues Virtualbox Linux Server from MAC Terminal

Post by Bhavani »

Thank you for the response -

I set my 2nd adapter to NAT and the internet is still not working -

I have attached the screenshot of my 2nd Adapter setting.

[root@Linuxos ~]# yum update -y
Oracle Linux 9 BaseOS Latest (x86_64) 0.0 B/s | 0 B 00:00
Errors during downloading metadata for repository 'ol9_baseos_latest':
- Curl error (6): Couldn't resolve host name for https://yum.oracle.com/repo/OracleLinux ... repomd.xml [Could not resolve host: yum.oracle.com]
Error: Failed to download metadata for repo 'ol9_baseos_latest': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
[root@Linuxos ~]#
[root@Linuxos ~]#
[root@Linuxos ~]#
[root@Linuxos ~]#
[root@Linuxos ~]# yum install python
Oracle Linux 9 BaseOS Latest (x86_64) 0.0 B/s | 0 B 00:00
Errors during downloading metadata for repository 'ol9_baseos_latest':
- Curl error (6): Couldn't resolve host name for https://yum.oracle.com/repo/OracleLinux ... repomd.xml [Could not resolve host: yum.oracle.com]
Error: Failed to download metadata for repo 'ol9_baseos_latest': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: connection issues Virtualbox Linux Server from MAC Terminal

Post by scottgus1 »

Please zip another VM .vbox file, log, and ifconfig's from host and VM.
Bhavani
Posts: 8
Joined: 10. Jul 2022, 19:41

Re: connection issues Virtualbox Linux Server from MAC Terminal

Post by Bhavani »

Thanks Again - I am attached the zp files of Log and vboxfiles .

Ifconfig from VM :

[root@Linuxos ~]# ifconfig
enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.56.3 netmask 255.255.255.0 broadcast 192.168.56.255
inet6 fe80::a00:27ff:fe11:bd2f prefixlen 64 scopeid 0x20<link>
ether 08:00:27:11:bd:2f txqueuelen 1000 (Ethernet)
RX packets 106 bytes 14296 (13.9 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 96 bytes 12874 (12.5 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

enp0s8: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
ether 08:00:27:d4:a3:a6 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
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 179 bytes 14809 (14.4 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 179 bytes 14809 (14.4 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0


ifconfig from MAC :

Bhavanis-MBP:~ bhavanidhulipalla$ ifconfig
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
options=1203<RXCSUM,TXCSUM,TXSTATUS,SW_TIMESTAMP>
inet 127.0.0.1 netmask 0xff000000
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
nd6 options=201<PERFORMNUD,DAD>
gif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280
stf0: flags=0<> mtu 1280
en5: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
ether ac:de:48:00:11:22
inet6 fe80::aede:48ff:fe00:1122%en5 prefixlen 64 scopeid 0x4
nd6 options=201<PERFORMNUD,DAD>
media: autoselect (100baseTX <full-duplex>)
status: active
ap1: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
options=400<CHANNEL_IO>
ether f2:18:98:8d:09:56
media: autoselect
status: inactive
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=6463<RXCSUM,TXCSUM,TSO4,TSO6,CHANNEL_IO,PARTIAL_CSUM,ZEROINVERT_CSUM>
ether f0:18:98:8d:09:56
inet6 fe80::1c69:2551:e5fa:15e%en0 prefixlen 64 secured scopeid 0x6
inet 192.168.1.204 netmask 0xffffff00 broadcast 192.168.1.255
inet6 2600:6c40:4a00:33ec:18de:f1a8:0:d53d prefixlen 64 autoconf secured
inet6 2600:6c40:4a00:33ec:5d45:38cd:7c62:a57f prefixlen 64 autoconf temporary
inet6 2600:6c40:4a00:33ec::196b prefixlen 64 dynamic
nd6 options=201<PERFORMNUD,DAD>
media: autoselect
status: active
awdl0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
options=400<CHANNEL_IO>
ether aa:1e:b0:a7:3d:67
inet6 fe80::a81e:b0ff:fea7:3d67%awdl0 prefixlen 64 scopeid 0x7
nd6 options=201<PERFORMNUD,DAD>
media: autoselect
status: active
llw0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=400<CHANNEL_IO>
ether aa:1e:b0:a7:3d:67
inet6 fe80::a81e:b0ff:fea7:3d67%llw0 prefixlen 64 scopeid 0x8
nd6 options=201<PERFORMNUD,DAD>
media: autoselect
status: active
en4: flags=8963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
options=460<TSO4,TSO6,CHANNEL_IO>
ether 82:ad:84:42:28:04
media: autoselect <full-duplex>
status: inactive
en1: flags=8963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
options=460<TSO4,TSO6,CHANNEL_IO>
ether 82:ad:84:42:28:01
media: autoselect <full-duplex>
status: inactive
en3: flags=8963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
options=460<TSO4,TSO6,CHANNEL_IO>
ether 82:ad:84:42:28:05
media: autoselect <full-duplex>
status: inactive
en2: flags=8963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
options=460<TSO4,TSO6,CHANNEL_IO>
ether 82:ad:84:42:28:00
media: autoselect <full-duplex>
status: inactive
bridge0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=63<RXCSUM,TXCSUM,TSO4,TSO6>
ether 82:ad:84:42:28:01
Configuration:
id 0:0:0:0:0:0 priority 0 hellotime 0 fwddelay 0
maxage 0 holdcnt 0 proto stp maxaddr 100 timeout 1200
root id 0:0:0:0:0:0 priority 0 ifcost 0 port 0
ipfilter disabled flags 0x0
member: en1 flags=3<LEARNING,DISCOVER>
ifmaxaddr 0 port 10 priority 0 path cost 0
member: en2 flags=3<LEARNING,DISCOVER>
ifmaxaddr 0 port 12 priority 0 path cost 0
member: en3 flags=3<LEARNING,DISCOVER>
ifmaxaddr 0 port 11 priority 0 path cost 0
member: en4 flags=3<LEARNING,DISCOVER>
ifmaxaddr 0 port 9 priority 0 path cost 0
nd6 options=201<PERFORMNUD,DAD>
media: <unknown type>
status: inactive
utun0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1380
inet6 fe80::2583:73f7:9a90:8041%utun0 prefixlen 64 scopeid 0xe
nd6 options=201<PERFORMNUD,DAD>
utun1: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 2000
inet6 fe80::1280:cecb:9fd5:c94c%utun1 prefixlen 64 scopeid 0xf
nd6 options=201<PERFORMNUD,DAD>
utun2: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1000
inet6 fe80::ce81:b1c:bd2c:69e%utun2 prefixlen 64 scopeid 0x10
nd6 options=201<PERFORMNUD,DAD>
vboxnet0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
ether 0a:00:27:00:00:00
inet 192.168.56.1 netmask 0xffffff00 broadcast 192.168.56.255
Attachments
Logs.zip
(121.45 KiB) Downloaded 3 times
Linuxos.vbox.zip
(1.53 KiB) Downloaded 4 times
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: connection issues Virtualbox Linux Server from MAC Terminal

Post by scottgus1 »

Everything in Virtualbox looks like it is working correctly. The second adapter is set to NAT, with a 10.0.3.# address space. However, the VM OS's enp0s8 adapter is not picking up the offered 10.0.3.15 IP address. I have seen this anecdotally, where Linux VM adapters don't notice a change in Virtualbox network types.

Please try to reset the enp0s8 adapter inside the Linux OS. Web-search how to do this, I regrettably don't know how. Issue the commands to take the adapter 'down' then 'up'? You'll want to see a 10.0.3.15 IP address in the enp0s8's ipconfig, then the VM should get internet.
Bhavani
Posts: 8
Joined: 10. Jul 2022, 19:41

Re: connection issues Virtualbox Linux Server from MAC Terminal

Post by Bhavani »

THANK YOU SO MUCH!!!1

I finally got it working - just needed to enable the adapter inside the VM -
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: connection issues Virtualbox Linux Server from MAC Terminal

Post by scottgus1 »

Great! Glad you're up and running!
Post Reply