canonical / multipass

Multipass orchestrates virtual Ubuntu instances
https://multipass.run
GNU General Public License v3.0
7.79k stars 643 forks source link

Can't communicate VM from NAT Traversal with driver virtualbox #3255

Open Ninjaxsh opened 1 year ago

Ninjaxsh commented 1 year ago

Describe the bug Can't communicate VM from NAT Traversal with driver virtualbox

To Reproduce

System:MacOS Ventury + virtualbox 7.0 firewall:off DHCP:on

1.multipass set local.bridged-network=en0 2.multipass set local.driver=qemu 3.multipass launch jammy --name ubuntu-q --network en0 4.It works perfectly from local network and NAT Traversal 5.multipass set local.driver=virtualbox 6.multipass launch jammy --name ubuntu-v --network en0 7.It works perfectly from local network, but can't connect this VM from NAT Traversal

Expected behavior NAT Traversal + virtualbox

Logs none

Additional info

sh-3.2# multipass version multipass 1.12.2+mac multipassd 1.12.2+mac

sh-3.2# multipass get local.driver virtualbox

sh-3.2# multipass info --all Name: ubuntu-v-1p State: Running IPv4: 192.168.16.143 Release: Ubuntu 22.04.3 LTS Image hash: 5bed3f233c24 (Ubuntu 22.04 LTS) CPU(s): 8 Load: 0.28 0.06 0.02 Disk usage: 1.4GiB out of 193.8GiB Memory usage: 186.0MiB out of 3.8GiB Mounts: --

Ninjaxsh commented 1 year ago

from local

skpc@SK-PC ~ % ssh root@192.168.16.143 root@192.168.16.143's password: Welcome to Ubuntu 22.04.3 LTS (GNU/Linux 5.15.0-86-generic x86_64)

from remote(if switch back to qemu,it works well.) has configed:n.mydomain.com'port 7022 <--> vm's port 22

C:\Users\SKPC>ssh root@n.mydomain.com -p 7022 kex_exchange_identification: Connection closed by remote host

Lillian364 commented 1 year ago

Describe the bug Can't communicate VM from NAT Traversal with driver virtualbox

To Reproduce

System:MacOS Ventury + virtualbox 7.0 firewall:off DHCP:on

1.multipass set local.bridged-network=en0 2.multipass set local.driver=qemu 3.multipass launch jammy --name ubuntu-q --network en0 4.It works perfectly from local network and NAT Traversal 5.multipass set local.driver=virtualbox 6.multipass launch jammy --name ubuntu-v --network en0 7.It works perfectly from local network, but can't connect this VM from NAT Traversal

Expected behavior NAT Traversal + virtualbox

Logs none

Additional info

  • OS: macOS 13

sh-3.2# multipass version multipass 1.12.2+mac multipassd 1.12.2+mac

sh-3.2# multipass get local.driver virtualbox

sh-3.2# multipass info --all Name: ubuntu-v-1p State: Running IPv4: 192.168.16.143 Release: Ubuntu 22.04.3 LTS Image hash: 5bed3f233c24 (Ubuntu 22.04 LTS) CPU(s): 8 Load: 0.28 0.06 0.02 Disk usage: 1.4GiB out of 193.8GiB Memory usage: 186.0MiB out of 3.8GiB Mounts: --

andrei-toterman commented 1 year ago

Hey, @markxsq! Given that this works on qemu, this might be a limitation in VirtualBox itself, due to how its networking is implemented. Were you ever able to achieve what you want by using VirtualBox directly instead of through Multipass?

Ninjaxsh commented 1 year ago

Hey, @markxsq! Given that this works on qemu, this might be a limitation in VirtualBox itself, due to how its networking is implemented. Were you ever able to achieve what you want by using VirtualBox directly instead of through Multipass?

I try to build a Vm directly with virtualbox started from application and it woks perfectly.

The problem seems to be related to the manual.

_Use VirtualBox to view Multipass instances Multipass runs as the root user, so to see the instances in VirtualBox, or through the VBoxManage command, you have to run those as root, too. To see the instances in VirtualBox, execute:

$ sudo VirtualBox_

andrei-toterman commented 12 months ago

When creating a VirtualBox vm directly, what image are you using? Are you setting up its network in some special way?

Also, can you please give some more concrete steps for us to try to reproduce the issue?

Ninjaxsh commented 12 months ago

When creating a VirtualBox vm directly, what image are you using? Are you setting up its network in some special way?

Also, can you please give some more concrete steps for us to try to reproduce the issue?

System:MacOS Ventury + virtualbox 7.0 firewall:off DHCP:on (192.168.16.1)

operation steps

skpc@SK-PC ~ % multipass networks Name Type Description en0 ethernet Ethernet en1 wifi Wi-Fi

1.set up multipass by default 2.find out phyical network : here is en0 (ip:192.168.16.16) 3.shell : multipass set local.bridged-network=en0 4.shell : multipass set local.driver=virtualbox 5.shell : multipass launch jammy --name ubuntu-v --network en0 7.ubuntu-v will get dhcp ip:192.168.16.70 8.host and ubuntu-v can communicate directly 9.deploy a port eg. from remote port 7022 to local port 22 target ip 192.168.16.70 with frpc 10.shell : ssh root@frps's ip -p 7022 kex_exchange_identification: Connection closed by remote host