Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ppggff opened this issue May 25, 2023 · 4 comments
Open

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

ppggff opened this issue May 25, 2023 · 4 comments

Comments

@ppggff
Copy link

ppggff commented May 25, 2023

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

@cfergeau
Copy link
Contributor

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 [email protected]. Would this be enough for your needs?
I never tried connecting a VM using gvisor-tap-vsock to a VPN, but that might work (?)

@gbraad
Copy link
Member

gbraad commented Jan 10, 2024

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.

@nirs
Copy link

nirs commented Aug 17, 2024

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?

@cfergeau
Copy link
Contributor

cfergeau commented Sep 4, 2024

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 crc-org/vfkit#180 (I know you opened it/know about it :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants