I wasted time when sshing from the host OS to the guest OS on VirtualBox. Summarize the trajectory.
The method of ssh connection is as follows
With the above settings, you should be able to make an SSH connection between "Host OS → Guest OS" and "Guest OS ⇔ Guest OS".
However, I couldn't do it in my environment, probably because the initial construction method was bad.
So, I checked the following two ways.
systemctl status sshd
Since it was "active", there was no problem.
nmcli device
"Disconnected" ... why not! !! When I restarted, it seems that the connection was lost. So, modify the config file. Change "ONBOOT = no" in the file "/ etc / sysconfig / network-scripts / ifcfg-enpXX" to "ONBOOT = yes" and reboot.
As a result of the above, a wonderful SSH connection is possible. I'm happy.
You can check the IP with ifconfig.
Reference URL ①: https://www.shookuro.com/entry/2018/02/10/172724 Reference URL ②: https://restypi.hatenablog.com/entry/2018/05/15/VirtualBox%E4%B8%8A%E3%81%AE_CentOS_%E3%81%AB_ssh_%E6%8E%A5%E7%B6 % 9A% E3% 81% 99% E3% 82% 8B_% 5B_Windows_% E7% B7% A8% 5D
Recommended Posts