linux系统安装相关(虚拟机)
virtualbox安装linux虚拟机(centos版)
- 下载centos镜像https://www.centos.org/
- 下载virtualbox软件https://www.virtualbox.org/wiki/Downloads
- 设置网络环境(桥接模式)
-
新建的虚拟机的设置中,网络选择桥接模式,界面模式选择系统使用的网卡
-
设置虚拟机的network信息
cd /etc/sysconfig/network-scripts/ vi ifcfg-enp0s3 添加网卡配置信息 BOOTPROTO=static #由dhcp(自动分配)调整为static(静态ip地址) ONBOOT=yes IPADDR=192.168.31.200 #静态ip NETMASK=255.255.255.0 #子网掩码 GATEWAY=192.168.31.1 #网管 DNS1=192.168.31.1 #dns ZONE=public 重启网络服务 systemctl restart network
-
配置镜像源地址
cd /etc/yum.repos.d/
vi CentOS-Base.repo
###################################aliyun镜像##########################
[base]
name=CentOS-$releasever
enabled=1
failovermethod=priority
baseurl=https://mirrors.aliyun.com/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
[updates]
name=CentOS-$releasever
enabled=1
failovermethod=priority
baseurl=https://mirrors.aliyun.com/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
[extras]
name=CentOS-$releasever
enabled=1
failovermethod=priority
baseurl=https://mirrors.aliyun.com/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
##########################################################################