zoukankan      html  css  js  c++  java
  • VirtualBox 安装 centos7

    1、准备条件

      VirtualBox(6.1.4)、centos7 镜像(此文使用的是CentOS-7-x86_64-Minimal-1908.iso)  

      本文是 Mac 环境下的安装.(之所以选择 6.1.4 版本的 VirtualBox,是因为低版本不兼容.这个会有一个问题,会在最后补充中说明)

      1.1 VirtualBox 下载地址

        https://www.virtualbox.org/wiki/Downloads

      1.2 Centos 7 镜像下载地址()

        http://isoredirect.centos.org/centos/7/isos/x86_64/

    2、安装

    2.1 配置基本信息

      

      

      

     

    2.2 开始安装

      

     

     

     

      

    这里可以设置 root 密码,也可以创建用户,根据自己需求.

     

     等待安装完成重启。

    2.3 修改配置

      ##更新 如下两个文件的配置
      /etc/sysconfig/network-scripts/ifcfg-enp0s3
      /etc/sysconfig/network-scripts/ifcfg-enp0s3
      onboot=yes
     
      ##然后重启网络
      servcie network restart

    3、更改 yum 的配置

    3.1 下载阿里云的repo

      [root@k8s-master ~]# yum install -y  wget    

          [root@centos7 /]# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
      [root@centos7 /]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

    3.2 清除缓存并生成新的缓存

    [root@centos7 /]# yum clean all
    [root@centos7 /]# yum makecache

     

    3.3 验证

    安装net-tools工具,运行ifconfig命令

    yum install -y net-tools

    3.4. 关闭防火墙

    [root@k8s-master ~]# firewall-cmd --state
    running
    [root@k8s-master ~]# systemctl stop firewalld.service
    [root@k8s-master ~]# systemctl disable firewalld.service
    Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
    Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.

    firewall-cmd --state #查看防火墙状态

    systemctl stop firewalld.service #停止firewall
    systemctl disable firewalld.service #禁止firewall开机启动


    3.5. 关闭selinux

    [root@k8s-master ~]# getenforce
    Enforcing
    [root@k8s-master ~]# setenforce 0
    [root@k8s-master ~]# sed -i 's/^ *SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config

    #查看selinux状态

    getenforce

    #临时关闭selinux
    setenforce 0 

    #永久关闭(需重启系统)
    sed -i 's/^ *SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config 

    至此完成Centos7.6操作系统安装和优化。                                                                           

    补充:

    1)、Mac 的 VirtulBox6.X 版本的 host-only 配置没有了,怎么配置?

      

      现在需要这么来设置: 

      

     

  • 相关阅读:
    fedora 20 安裝 及 配置桌面環境
    2014上半年—Linux操作系统—嵌入式开发—中考
    【hdu 1864】最大报销额
    【hdu 1067】Gap
    【t055】成绩统计
    【b094&&z14】靶形数独
    【z06】观光公交
    【u213&&t037】修剪花卉
    【t062】最厉害的机器人
    【t075】郁闷的记者
  • 原文地址:https://www.cnblogs.com/zhuzi91/p/12356856.html
Copyright © 2011-2022 走看看