#226

Is it possible to access vm directly through it's ip on host?

Openppggffopened 3y ago

Can this be achieved with some configuration in host? such as vpn?

Activity

4
cfergeau3y ago

You can expose some ports from the VM on the host, which allows you to access them from the host using 127.0.0.1:$port_number. For example you can expose port 22 on the VM as port 2222 on the host, and then use ssh -p 2222 user@127.0.0.1. Would this be enough for your needs? I never tried connecting a VM using gvisor-tap-vsock to a VPN, but that might work (?)

gbraad2y ago

What kind of connection would you like? As mentioned, you can utilize SSH and then use the -D option to access the host over socks. Another option could be to install a tool like Tailscale inside the VM which would expose it as a node on a overlay network. There are many options, but perhaps some specifics of what you want to achieve might help to assist you better.

nirs2y ago

I would like to get similar network setup to libvirt - you can access all vms from the host or from other vms, and access the host from the vms.

Our use case: running multiple minikube clusters for testing RamenDR. We use libvirt on Linux and hopefully we can use with vfkit and gvproxy to get similar setup on Apple silicon.

Does it make sense for gvproxy to provide this?

cfergeau2y ago

usermode networking in libvirt (through slirp) does not allow access from host to VM without an explicit port forwarding. It probably also blocks VM/VM communication. I think what you are describing is when libvirt is working using bridged networking which imo is something to be configured in the OS/hypervisor, not in the usermode networking stack. The corresponding vfkit bug is https://github.com/crc-org/vfkit/issues/180 (I know you opened it/know about it :)