Page 1 of 1

[Solved] Cannot ping guest from host

PostPosted: 26. Apr 2019, 14:05
by PeterOEM
Hi.

I am trying to setup a virtual machine running Linux on my Windows PC. My ultimate goal is to use GameMaker 2 to create arcade style games and run them on a banana pi board, so I can develop and build arcade machinces as a project with my high school students. But before I can do that, I need an Ubuntu device to compile the games into files that Linux can run on the banana pi board. I wish to use VirtualBox as my Ubuntu device.

I'm new to virtual machines and Linux, so I'm a bit out of my depth here. I have installed VirtualBox and installed Ubuntu 18.04. It seems to be working, and I am connected to the internet on the guest when using NAT network. But I cannot pint it from my host.

I've tried the following:
  • Changing NAT network to bridge on the VM (this messes up the internet connection on the VM).
  • Changing NAT network to Only Hosted Networks. I cannot find any Networks in VirtualBox > File > Settings > Network. Also messes up the internet on the VM.
  • Changing my Ubuntu guest to static IP, since I read somewhere that the three first parts of the IP address has to be the same on the host and guest. Every time I try to change to static IP, I lose internet connection on the VM.
    Ifconfig on virtual machine says:
    inet 10.0.2.15 netmas 255.255.255.0 broadcast 10.0.2.255
    Ipconfig on host says:
    IPv4 Address. . . . . . . . . . . : 192.168.56.1(Preferred)
I am worried that the problem might be because I'm on a work computer, and the IT department has put some sort of restriction on it.

Thanks,
Peter

Re: Cannot ping guest from host

PostPosted: 26. Apr 2019, 14:40
by andyp73
If you configure your Ubuntu guest with bridged networking and it has the DHCP client enabled then you should get a 192.168.56.x IP address from the network DHCP server as the guest looks just like any other computer on the network. This is probably the route that you will need to go down if you also want to access the Banana PI on the same network.

There are a couple of potential issues with this - firstly, bridging to a wireless device doesn't always work, secondly, if there are any proxy settings needed on the host they will also be needed in the guest.

Can you configure the guest as bridged and post the output of the command "ifconfig -a" or "ip addr show" whichever your flavour of Ubuntu supports.

-Andy.

Re: Cannot ping guest from host

PostPosted: 26. Apr 2019, 22:15
by PeterOEM
andyp73 wrote:If you configure your Ubuntu guest with bridged networking and it has the DHCP client enabled then you should get a 192.168.56.x IP address from the network DHCP server as the guest looks just like any other computer on the network. This is probably the route that you will need to go down if you also want to access the Banana PI on the same network.


Thanks, Andy. Changing to bridged networking WITHOUT touching anything else did the trick.

I thought I had already tried that, but I must have touched something else as well :)

Re: Cannot ping guest from host

PostPosted: 27. Apr 2019, 11:07
by socratis
Marked as [Solved].