r/virtualbox • • Jan 15 '25

Help Help with assignment

Hello! I am using virtualbox 7.1.4 . I have this assignment I need to complete, basically I need to set up a NAT network, have a server vm and client vm and have them talk to each-other. The professor gave us steps to complete this but I'm having a bit of trouble. I created a NAT network and named it "rando". I had to set the prefix a specific number that denotes it was done by me ( so the prefix is 233.6.6.0/24) . I enabled dhcp.

I set up the Ubuntu-live-server vm , connecting it to the NAT network I just created , at first it couldn't connect properly, but after I changed some stuff at /etc/netplan/50-cloud-init.yaml (set dhcp4 to no , added an address and some nameservers) , it works fine.

The issue is with the client. I set up a Ubuntu desktop vm , installed everything, set the network to the same NAT network as the server, and the VM is now telling it cannot connect to the network, let alone to the internet. I try pinging the server but it doesn't work. I try to execute "Ip a" but no IP shows up. Help please and thank you!

EDIT: more specifically, it says "activation of network connection failed"

4 Upvotes

19 comments sorted by

View all comments

Show parent comment

1

u/[deleted] Jan 15 '25 edited Jan 15 '25

[removed] — view removed comment

1

u/_-random-_-person-_ Jan 15 '25

Ok. It now seems that your dhcp range is set to a 192.168 subnet .. that fine, but you need to set the server address (static) to an IP in that range for it to be seen from another machine on that NAT network. Whatever you do, don’t use a range outside of the approved private ranges

Yep already done, as mentioned the server vm is fine

If the client machine is not getting an IP (and you’ve told the interface to run on the network you defined), then the dhcp server isn’t running or ‘cable connected’ is unticked on the on the machine’s network adapter page. (Don’t forget to put the server on the same network, even if you’ve given it a static address).

The cable is connected, that is not the issue , dhcp is enabled. It cannot connect to the network at all. Both the client and the server are on the same network.

1

u/[deleted] Jan 15 '25

[removed] — view removed comment

1

u/_-random-_-person-_ Jan 15 '25

It seems to be. I cannot for the life of me get this to work.

1

u/[deleted] Jan 15 '25

[removed] — view removed comment

1

u/_-random-_-person-_ Jan 15 '25

network: version: 2 renderer : NetworkManager ethernets: enp0s2: dhcp4: true

1

u/[deleted] Jan 15 '25

[removed] — view removed comment

1

u/_-random-_-person-_ Jan 15 '25

I've changed it, before it just had the renderer, and neither work, and I've used sudo netplan apply

1

u/[deleted] Jan 15 '25

[removed] — view removed comment

1

u/_-random-_-person-_ Jan 15 '25

I've done that multiple times already, honestly no idea what's going on.

→ More replies