配置静态ip
首先使用ifconfig命令查看网卡名称。
ifconfig
得到网卡名称ens32 。
打开网卡配置文件配置静态ip,重启生效。
vi /etc/netplan/*-cloud-init.yaml
network:
ethernets:
ens32:
dhcp4: no #dhcp4关闭
addresses: [192.168.228.130/24]
gateway4: 192.168.228.1
nameservers:
addresses: [8.8.8.8, 114.114.114.114]
version: 2
配置root密码并支持ssh登录
设置root密码并修改ssh配置文件 并重新ssh服务
sudo su
passwd root
vim /etc/ssh/sshd_config
#PermitRootLogin prohibit-password
PermitRootLogin yes
/etc/init.d/ssh restart
设置自动挂载共享文件夹(vm)
手动挂载
vmhgfs-fuse .host:/ /mnt/hgfs/
自动挂载,修改/etc/fstab,最后一行加入如下内容
.host:/ /mnt/hgfs fuse.vmhgfs-fuse allow_other,defaults 0 0
设置本地时区
timedatectl list-timezones | grep Shanghai
timedatectl set-timezone Asia/Shanghai