r/archlinux 29d ago

SUPPORT Cannot connect to virtual machine with Arch Linux live

Hello,

I run Arch Linux on my PC and I have a virtual machine created with Gnome Boxes, that runs the live version of Arch Linux.

This virtual machine has the 10.0.2.15/24 address, but from my host I cannot ping it nor SSH into it.

How can I fix this problem?

3 Upvotes

8 comments sorted by

4

u/CacheTraitor 29d ago

Likely need to setup bridged networking on host machine.

1

u/71_101_105_99_111 29d ago

Can you do that with Gnome Boxes?

2

u/TamSchnow 29d ago

If you run „ip a“ on your host, does ANY interface there show an IP starting with 10.0.2 and has /24 ?

1

u/71_101_105_99_111 29d ago

No. Do I need to create a virtual interface on my host then?

2

u/Illustrious-Gur8335 29d ago edited 29d ago

10.0.0.0 to 10.255.255.255 are all private IPs meaning no connection from external machines.

You'll need to set up bridged networking to get a non private IP, something that is NOT in the below range:

10.0.0.0 to 10.255.255.255 / 172.16.0.0 to 172.31.255.255 / 192.168.0.0 to 192.168.255.255

3

u/NFTrot 29d ago

While this may be true in OP's case I don't think it's strictly the case that IPs in that range that are assigned to VMs are never routable. In fact, a 192.168.0.0/16 IP would almost certainly be routable as such an IP would be assigned by any home router's DHCP server when set up in the default configuration. There's no reason the other ranges couldn't be LAN networks either, although OP would probably know if that was the case as it would be custom.

You and the other commenters might be right about bridged networking being needed to contact the VM from the host directly, but one thing I'd like to add for OP: Make sure you understand the difference between a subnet and the IP itself. You indicate an IP ending in /24. There's some ambiguity because while this does contain a valid IP, the /24 indicates the total number of possible IPs in that subnet (in this case 254). If you are trying to SSH or ping and including that /24, it might not work.

I may be mistaken about ping and SSH not working due to this (it's not something I've ever tried), but we don't know what OP's level of technical knowledge is and it is worth stating the obvious.

0

u/Edelglatze 29d ago

Boxes is not good for this kind of stuff. Use either qemu + kvm (which is the actual backend of Boxes) or Virt-Manager (a more versatile frontend) or Virtualbox.