Q
Q
qwertyuih2017-11-25 23:04:37
Android
qwertyuih, 2017-11-25 23:04:37

How to properly set up networking in virtualbox?

In matters of connecting the network, he is completely not special, so there was a difficulty in setting it up. Installed VirtualBox, created ubuntu server machine. According to tutorials from the Internet, I set up the /etc/network/interfaces file in the following way:

iface enp0s3 inet static
address 192.168.0.111
netmask 255.255.255.0

iface enp0s8 inet dhcp
auto enp0s8

5a19ca0aaf710259983238.png
and in the settings of the machine itself I set 2 adapters (no changes):
  • Virtual host adapter
  • NAT

With this configuration, the guest OS has Internet (I check via ping), but I can’t reach it from the host OS (via the browser http://192.168.0.111).
If you swap the settings:
iface enp0s3 inet dhcp
auto enp0s8

iface enp0s8 inet static
address 192.168.0.111
netmask 255.255.255.0

and swap the adapters of the working machine, then I connect to the server from the host OS, but the Internet in the guest OS disappears:
ping ya.ru
uknown host ya.ru
.
Network settings of VirtualBox itself:
5a19cc61c9fd3448494717.png
How to do it right so that everything works?)

Answer the question

In order to leave comments, you need to log in

5 answer(s)
E
EVGENY T., 2019-09-09
@Beshere

There must be a server that creates games and clients that connect to it. The server is a separate host, or one of the tablets.

L
Lone Ice, 2019-09-09
@daemonhk

Finger to the sky:
1. We have a server that processes our game
2. We are waiting for a connection of 8 players, no more, no less
3. Players play
4. The server closes the connection (throws players, breaks the session) after 30 seconds.
5. The server calculates the ratings of the players and shows everyone the same, marking the current score for the player holding the tablet in his hands.
I don’t know any of the stacks presented, so I can’t give specific advice.

M
mopsicus, 2019-09-09
@mopsicus

What is there to understand? If you have never made a multiplayer session game, then just google to read and try to do it. Naturally, you need a server that will keep connections and send messages. No one will write the code for you, so the question itself is not clear.

A
alotofQ, 2019-09-12
@alotofQ

Watch a couple of videos on unity + photon
Most often in the videos it is the session model of the game. One of the players is the server

Q
qwertyuih, 2017-11-26
@qwertyuih

The problem was solved by setting the DNS address "8.8.8.8" in the connection settings of VirtualBox/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question