实战 | VirtualBox下安装CentOS7系统 笔记
1.安装虚拟机
华为下载地址:
https://repo.huaweicloud.com/centos/7/isos/x86_64/
详情见本文
https://zhuanlan.zhihu.com/p/60664647
2.设置网络
3.替换源
配置公司的 yum 源,修改 /etc/yum.repos.d/CentOS-Base.repo 的内容如下
[base] name=EulerOS-2.0SP5 base baseurl=http://developer.huawei.com/ict/site-euleros/euleros/repo/yum/2.5/os/x86_64/ enabled=1 gpgcheck=1 gpgkey=http://developer.huawei.com/ict/site-euleros/euleros/repo/yum/2.5/os/RPM-GPG-KEY-EulerOS
4.开启挂载
# 挂载命令
# mount -t vboxsf share_dir_name linux_mount_dir_path
mount -t vboxsf sf-centos7 /root/sf1/
# centos
lsscsi
mkdir /media/cdrom
mount /dev/sr0 /media/cdrom
yum install bzip2
./VBoxLinuxAdditions.run
faq:
VirtualBox: mount.vboxsf: mounting failed with the error: No such device [closed]
cd /opt/VBoxGuestAdditions-*/init
sudo ./vboxadd setup
virtualbox安装增强功能报错“modprobe vboxguest failed”
1. 安装kernel-devel,并将kernel和kernel-devel更新至同一版本
yum install -y kernel-devel gcc //安装kernel-devel和gcc编译工具链
yum -y upgrade kernel kernel-devel //更新kernel和kernel-devel到最新版本
reboot
2. 以新版本内核启动,并删除旧版本内核
uname -r
rpm -qa | grep kernel-[0-9] //查看全部的内核
yum remove 旧版本内核 //删除旧版本内核
详情见:
https://blog.csdn.net/mychangee/article/details/104257794
# 停止 docker 服务
sudo systemctl stop docker.socket
sudo systemctl stop docker.service
5.网络:
配置VirtualBox虚拟机访问外网,并于宿主机互联互通:
参考:https://blog.csdn.net/hello5orld/article/details/83651156
http://3ms.huawei.com/hi/restnew/attach?app_id=79&w3_id=gWX1103197&fid=1442283557&type=1&gid=2034483&blogId=13423247
linux服务器快速配置http代理访问外网方法:
1. 在本地运行PortMapping.exe,工具见附件
2. 在linux服务器上执行以下命令,设置外网代理,其中代理ip为本地和Linux节点相通的IP,一般为50网段
export http_proxy=http://p_atlas:proxy%40123@代理ip:6688
export https_proxy=http://p_atlas:proxy%40123@代理ip:6688
3. 测试:
wget www.baidu.com
4. centos设置仓库为阿里源
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum clean all && yum mackecache
本文来自博客园,作者:易先讯,转载请注明原文链接:https://www.cnblogs.com/gongxianjin/p/17091800.html