Install CentOS7 on VirtualBox
I download everything/minimal ISO from this website https://www.centos.org/download/
On VirtualBox, Name centos-dev1, Linux, Red Hat (64-bit)
It is straightforward to install the ISO on that.
Check the network after installation
> ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 08:00:27:0e:06:17 brd ff:ff:ff:ff:ff:ff
inet 10.0.2.15/24 brd 10.0.2.255 scope global dynamic enp0s3
valid_lft 86188sec preferred_lft 86188sec
inet6 fe80::dfc1:c00c:361f:fea8/64 scope link
valid_lft forever preferred_lft forever
3: enp0s8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 08:00:27:66:f1:b6 brd ff:ff:ff:ff:ff:ff
inet 192.168.56.102/24 brd 192.168.56.255 scope global enp0s8
valid_lft forever preferred_lft forever
inet6 fe80::a00:27ff:fe66:f1b6/64 scope link
valid_lft forever preferred_lft forever
Go to the network setting directory
> cd /etc/sysconfig/network-scripts/
Open the configuration file, change the last line as follow:
> sudo vi ifcfg-enp0s3
ONBOOT=yes
Enable the second network adapter on VirtualBox, copy and set the configuration file for the second network
> sudo cp ifcfg-enp0s3 ifcfg-enp0s8
> cat ifcfg-enp0s8
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=static
IPADDR=192.168.56.102
NETMASK=255.255.255.0
NM_CONTROLLED=no
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=enp0s8
UUID=05648fe2-6f3e-4384-bac2-6db95fb14d8e
DEVICE=enp0s8
ONBOOT=yes
Yeah, if you ssh to the IP 192.168.56.102, it will work.
Till now, I have a ubuntu and a CentOS running on my VirtualBox now.
References:
https://www.centos.org/download/
http://www.jeramysingleton.com/install-centos-7-minimal-in-virtualbox/
http://ask.xmodulo.com/configure-static-ip-address-centos7.html
I download everything/minimal ISO from this website https://www.centos.org/download/
On VirtualBox, Name centos-dev1, Linux, Red Hat (64-bit)
It is straightforward to install the ISO on that.
Check the network after installation
> ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 08:00:27:0e:06:17 brd ff:ff:ff:ff:ff:ff
inet 10.0.2.15/24 brd 10.0.2.255 scope global dynamic enp0s3
valid_lft 86188sec preferred_lft 86188sec
inet6 fe80::dfc1:c00c:361f:fea8/64 scope link
valid_lft forever preferred_lft forever
3: enp0s8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 08:00:27:66:f1:b6 brd ff:ff:ff:ff:ff:ff
inet 192.168.56.102/24 brd 192.168.56.255 scope global enp0s8
valid_lft forever preferred_lft forever
inet6 fe80::a00:27ff:fe66:f1b6/64 scope link
valid_lft forever preferred_lft forever
Go to the network setting directory
> cd /etc/sysconfig/network-scripts/
Open the configuration file, change the last line as follow:
> sudo vi ifcfg-enp0s3
ONBOOT=yes
Enable the second network adapter on VirtualBox, copy and set the configuration file for the second network
> sudo cp ifcfg-enp0s3 ifcfg-enp0s8
> cat ifcfg-enp0s8
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=static
IPADDR=192.168.56.102
NETMASK=255.255.255.0
NM_CONTROLLED=no
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=enp0s8
UUID=05648fe2-6f3e-4384-bac2-6db95fb14d8e
DEVICE=enp0s8
ONBOOT=yes
Yeah, if you ssh to the IP 192.168.56.102, it will work.
Till now, I have a ubuntu and a CentOS running on my VirtualBox now.
References:
https://www.centos.org/download/
http://www.jeramysingleton.com/install-centos-7-minimal-in-virtualbox/
http://ask.xmodulo.com/configure-static-ip-address-centos7.html
本文详细介绍了如何在 VirtualBox 上安装 CentOS 7,并配置静态 IP 地址。通过下载 CentOS 7 的 minimal ISO 文件,设置 VirtualBox 虚拟机参数,完成 CentOS 的安装过程。此外,还提供了网络配置的具体步骤,确保虚拟机能够正常联网。
1141

被折叠的 条评论
为什么被折叠?



