The only way to have direct access is to port forward any traffic to port 22 of your Virtual Machine.
I can't figure out an equivalent for VirtualBox. C:Program FilesOracleVirtualBox> VBoxManage modifyvm "CentOS8" --natpf1 "centos8,tcp,,2222,,22" In the above example, all TCP traffic arriving on port 2222 on any host interface will be forwarded to port 22 in the guest. Host OS X 10.8.3, VirtualBox 4.2.12. Using NAT as your Virtualbox network connection will create a private network connected to your host network. With qemu-kvm, I'm used to the virtual link having an IP address as well, and it is possible to ssh into the guest set to NAT. NAT模式即虚拟机的网络是完全依赖于物理主机的网络。此时两个系统并不是处于同一局域网，不能简单的ping通； 但是可以设置Virtualbox在NAT模式(网络地址转换NAT)下的端口转发规则，通过设置规则可使主机连接虚拟机。 How to SSH a Virtualbox through NAT configuration. After I navigate to VirtualBox home directory, execute below command to configure port forwarding in VirtualBox for NAT. Guest Fedora Linux 18 (or 19 beta), VirtualBox guest Network panel is Attached To: NAT (default) using the wireless connection.
Please follow this step: Start your virtual machine and login Internet and SSH access to VirtualBox VM with NAT and host-only adapters Posted on April 4, 2013 by Garth Having only recently started using VirtualBox to build various VMs (Virtual Machines), it wasn’t immediately obvious to me how I could not only enable access to the outside world (Internet access, updates etc.
Copyright 2020 VirtualBox NAT SSH