How to access gnome box vms over network

i can’t access vm that i have installed gnomebox app kvm i have connected my system over wifi.

Do you want to access the virtual machine from another PC in the network, or (via network) from the host running the virtual machine?

Anyway, by default, Boxes uses NAT. This means that the virtual machine lives in another (private) network that is inaccessible from outside, and the host machine act as a router. Just like your home router: your PC is in a private network that is unreachable from the internet, but via NAT, your PC can access the network.

Probably what you need is a bridge network on the host
With a bridged interface, you can assign an IP belonging to your network (statically or using the DCHP running in your network).

my networking is like 2layer 1st one is a switch and then i have connected one of the switch port with a router in dhcp mode. and i have 1 access point and a pc over lan with the initial primary switch…
now i have a vm setup with gnome boxs on my fedora host system which is connected with wifi.
i wish to connect ssh and control my vm with cockpit and i was also thinking to setup a pihole also as a sinkhole.
but i can’t access my vm with anything of those method i will not make my system to access from internet but from my local network i mean from the primary switch that i have and devices within my primary switch local network.

gnome boxes is made to be as simple as possible. As a result, it lacks many features.

One of those features is enabling bridged networking. Bridged networking makes it so the VM is on your actual network instead of a special internal VM network.

However, gnome boxes is just a front-end for libvirtd. That means you can change your VM settings using any frontend for libvirtd including those that are more feature rich such as virsh or Virtual Machine Manager(virt-manager).

I am not in front of my Fedora box right now but I think that when you install virt-manager/libvirtd on Fedora it creates a bridged network for you.

If not, here are instructions on how to do that.

1 Like

I had the same issue when I first started using a VM using libvirt and QEMU and the default network as NAT.
The host and VM were unable to communicate since the VM used a connection directly to the active LAN interface and was on a different subnet with its own built-in NAT.

My solution was to use bridged networking and the default virbr0 virtual interface. The host uses dhcp for the vm and the vm gets an address in the virbr0 subnet. The host also does forwarding and manages NAT for the vm.

My VMs are able to access the internet and I can connect directly both directions between the host and vm since NAT is not involved there. Virbr0 is actually just another interface on the host.

Since I use QEMU the management is done using VMM so I cannot give the details for Boxes. The fact that Boxes also uses libvirt should make it relatively simple to manage though.

I would venture that if you know the address assigned to the VM by your router then you may be able to access the vm that way even when using NAT.