Open up the Windows firewall for Oracle VirtualBox
- In Windows, search for the Windows Defender Firewall with Advanced Security App and open it.
- Select Inbound rules. Check the VirtualBox Manager rules and if they are not enabled, double click and enable the rules.
- Start Oracle VirtualBox.
- Select the Ubuntu VM, e.g. Ubuntu19. Click Settings. Then click Network.
- Click Port Forwarding.
- Click the Plus icon. Add in a new rule for Ssh with the Host Port set to 3022 and the Guest Port set to 22.
Note: 3022 would be the port number to use to remotely access the Ubuntu VM. - Click OK to all the dialog boxes.
- In Oracle VirtualBox, start the Ubuntu VM, e.g. Ubuntu19.
- Optional. If the openssh-server is not installed, then open up a Terminal and run the following command.
$ sudo apt install openssh-server - After the installation is completed, either reboot or restart the ssh service with the following command.
$ service ssh restart
Remote access via ssh
- On a remote PC, open up a Terminal.
- Type in the following command to connect to the remote Ubuntu VM instance.
$ ssh 192.168.8.157 -p 3022
Note: where 3022 is the port number and 192.168.8.157 is the example IP address of the Windows PC hosting the Ubuntu VM instance.The ssh prompt appears.
No comments:
Post a Comment