evansm7 / vftool

A simple macOS Virtualisation.framework wrapper
MIT License
994 stars 68 forks source link

Networking doesn’t work through NAT for Ubuntu cloud images #13

Open PraneetNeuro opened 3 years ago

javacom commented 3 years ago

You have to setup network bridge in your ubuntu vm

https://www.tecmint.com/create-network-bridge-in-ubuntu/amp/

PraneetNeuro commented 3 years ago

How do I install bridge-utils without a network?

javacom commented 3 years ago

I think you can install packages in the existing Ubuntu vm via the NAT for outgoing traffic. If not, you did not set it up properly in the first place and is not the problem of this vftool.

marcelorubim commented 3 years ago

For my is not working as well. What could I have done wrong?

javacom commented 3 years ago

Ok I end up using the port forwarding on macOS similar to the win10 wsl2 to port forward from the os to the ipaddress of the vm. Just like I created a radpberrypios image as vm as in

http://iphonesdkdev.blogspot.com/2020/12/20201203.html

I created the VM with vnc server installed. Set the vm fixed ip address of 192.168.64.10 and in macOS host I do the port forwarding to the ipaddress and port number of the vm using this script. Then other machines on the LAN can vnc connect to the vm through the ipaddress of the macOS host with port 5910.

`echo " rdr pass on lo0 inet proto tcp from any to self port 5910 -> 192.168.64.10 port 5901

rdr pass on en0 inet proto tcp from any to any port 5910 -> 192.168.64.10 port 5901

rdr pass on wlan0 inet proto tcp from any to any port 5910 -> 192.168.64.10 port 5901

" | sudo pfctl -ef -`