[LINUX] Trajectory when ssh connecting to guest OS on VirtualBox

Trajectory when ssh connecting to guest OS on VirtualBox

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

Trajectory when ssh connecting to guest OS on VirtualBox
Connect to centos6 on virtualbox with ssh connection from Mac
Steps to install VirtualBox on CentOS
Ansible role to prevent the initial confirmation message when connecting with SSH
Connecting from python to MySQL on CentOS 6.4
Easy way to use Python 2.7 on Cent OS 6
Preparing to run ImageMagick + im4java on Mac OS
Points to note when switching from NAOqi OS 2.4.3 to 2.5.5
How to set a shared folder with the host OS in CentOS7 on VirtualBOX