Build a programming environment Windows 03

Environment03

summary

Staticize the local IP of the Linux OS installed on the virtual platform.

purpose

  1. Install virtual environment
  2. Install virtual OS
  3. Staticize local address

3.Staticize local address

After installing Linux in the virtual environment, fix the local IP.

This is because if the IP is fixed, it is convenient to access from the host OS.

  • Guest OS IP confirmation

IP confirmation command

ip addr

route confirmation command

ip route

Make a note of the following guest IP and default gateway (routing table).

  • Interface settings

Use vi for editing.If you don’t understand the vi command, see the following for the time being.

Keyexplanation
hCursor leftCommand mode
jUnder the cursorCommand mode
kOn the cursorCommand mode
lCursor rightCommand mode
iInput modeInsert mode
escInput mode exitCommand mode

If you get lost, press “esc”!

Edit the Ethernet interface.

sudo vi /etc/sysconfig/network-scripts/ifcfg-enp0s3

If you can’t find the file, go up the hierarchy and look for it.

Add the following to the file:

BOOTPROTO=none
IPADDR=192.168.0.100
NETMASK=255.255.255.0
GATEWAY=192.168.0.1

DNS1=8.8.8.8
  • Reboot
sudo shutdown -r now
  • Reconfirm guest IP
ip addr

It is a fixed IP address safely.

Check if you can access the outside with the ping command

ping google.com
  • Tera Term

“Tera Term” is very convenient for accessing the guest OS from the host OS.

Please search for “Tera Term” and download the software.

When you start it, the following screen will appear, so enter the fixed IP and press OK.

Enter your username and password.

I was able to SSH into the guest OS safely.

End

That is all for building the programming environment.

good job today.

タイトルとURLをコピーしました