Windows 10 own virtual machine installation centos7

1. Installation of virtual machine reference

Hyper-v installs centos and configures the network graphic tutorial_Programmer-Dabai's blog-CSDN blog_hyperv installs centos7 and configures the network

Tip: If you change the network environment, you only need to do the following to restore it

  • Ensure that the machine can connect to the wired network normally and does not use virtual routing to jump.
  • Re-enter the virtual machine, edit the virtual route, and select the network card externally.
  • Back to the win computer, you can edit and specify a manual IP for the virtual router.

2. Official mirror address

CentOs official website download, CentOS domestic mirror download_strive_day's blog-CSDN blog_centos system download official website

3. Centos installs the samba service, and the shared directory can be quickly read and written by the windows host.

1. Check, install and configure samba service

rpm -qa|grep samba //检查是否已安装
yum install samba //安装

systemctl start smb  //启动服务
systemctl status smb //查看状态
systemctl enable smb //设置开机启动


#直接把root用户加入到Samba服务的用户列表中并给一个密码(该密码可以与系统root密码不一样)
#也可以自己useradd newuser,然后进行授权密码
smbpasswd -a root

#通过命令检查Samba用户是否添加成功:
pdbedit -L

systemctl restart smb #最后重启服务




2. Configure samba

vi /etc/samba/smb.conf //进入配置文件,最后新增如下

[xyf]   #新增加,登录名
        comment = share directories
        path = /winshare  #该目录必须要有权限,chmod 777 -R /winshare,共享给win7的目录
        public = yes
        browseable = yes  #可读
        writable = yes    #可写
        guest ok = yes    #设置免密码
        create mask = 0777  #可选,创建文件的权限,0代表十六进制
        directory mask = 0775 #可选,创建文件夹的权限,0代表十六进制

Test whether the configuration is normal

testparm -v

3. Focus on: Turn off the firewall and SELINUX

#关闭SELinux 
setenforce 0    设置SELinux 成为permissive模式,如果重启后依然有效需要更改如下配置
vi /etc/selinux/config 设置SELINUX=disabled,永久关闭

getenforce   #查看当前的状态


#关闭防火墙firewalld
systemctl stop firewalld
systemctl status firewalld

systemctl disable firewalld  #开机不启动
systemctl list-unit-files|grep firewalld    #查看开机列表

4. In Windows 10, enter \\192.168.xx.xx\xyf through win+r to directly open the shared directory. If you need to display the network location quick entry on My Computer, you need to add a mapped network drive.

 

おすすめ

転載: blog.csdn.net/wo240/article/details/126526950