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

How to set ip address #34

Open
marintrooper23 opened this issue Aug 13, 2024 · 4 comments
Open

How to set ip address #34

marintrooper23 opened this issue Aug 13, 2024 · 4 comments

Comments

@marintrooper23
Copy link

Hello! How do I assign an IP address to a virtual machine? For example, I may have the address 10.243.212.112 distributed to a guest machine on my host machine. How do I assign it?

@s-u
Copy link
Owner

s-u commented Aug 13, 2024

The VM framework is assigning IP addresses automatically in the 192.168.64/24 subnet, so the VM is accessible at 192.168.64.xx where xx is incremental. You can find the IP address with arp -an. By default everything else is NATed so the guest can reach to the host and outside.

If you need a more complex networking setup, then you can use the unix target -- have a look at the slirp proxy (see networking in the README) which can give you a lot more control about how you expose the guest.

@marintrooper23
Copy link
Author

Can you show an example of how to run with a unix parameter?

@marintrooper23
Copy link
Author

marintrooper23 commented Aug 13, 2024

For example, i run ./slirp_unix -p /opt/Management/macosvm/etalon -f 12345:12345
Then I run my vm: macosvm --net unix:"/opt/Management/macosvm/etalon" -g vm_sonoma.json
How can i get access into my vm from outside network?

@s-u
Copy link
Owner

s-u commented Aug 16, 2024

In your example above simply with host:12345 where host is the IP address of the host since the proxy is proxying all traffic on the 12345 port to the VM.

For example, if you use slirp_unix -f 1022:22 then ssh -p 1022 host from the outside will connect to the ssh of VM instead of the host.

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

2 participants