VMware配置虛擬機集羣

安裝增強功能(包括剪切板)

sudo apt install open-vm-tools 

不過感覺對服務器版都沒什麼用

共享文件夾

需要刷新掛載點才能看到文件夾

$ sudo ls /etc/hgfs
shared

刷新後需要重啓虛擬機才能看到更新

$ sudo ls /etc/hgfs
shared

刷新時可能會遇到如下報錯

Error -107 cannot open connection!

如果不想每次開機都要重新掛載,可以寫一個開機執行的腳本

$sudo tee /etc/rc.local <<-'EOF'
#!/bin/sh -e

sudo vmhgfs-fuse .host:/ /mnt/hgfs -o allow_other 

EOF
$sudo chmod +x /etc/rc.local

可以通過vmware-hgfsclient查看共享的文件

網絡配置

/etc/netplan/00-installer-config.yaml配置靜態IP

# This is the network config written by 'subiquity'
network:
  ethernets:
    ens33:
      dhcp4: no
      addresses: [192.168.0.253/23]
      nameservers:
        addresses: [8.8.8.8, 4.2.4.2]
      routes:
        - to: default
          via: 192.168.1.1
  version: 2

sudo netplan apply應用,ifconfig就可以看見新IP了

$ ifconfig
docker0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 172.17.0.1  netmask 255.255.0.0  broadcast 172.17.255.255
        ether 02:42:d6:99:49:3f  txqueuelen 0  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.253  netmask 255.255.254.0  broadcast 192.168.1.255
        inet6 fe80::250:56ff:fe36:49b9  prefixlen 64  scopeid 0x20<link>
        ether 00:50:56:36:49:b9  txqueuelen 1000  (Ethernet)
        RX packets 5760  bytes 460437 (460.4 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 4976  bytes 578021 (578.0 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 112  bytes 8876 (8.8 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 112  bytes 8876 (8.8 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

克隆好幾臺虛擬機

注意克隆後的虛擬機橋接網絡中的IP也都是一樣的,需要去/etc/netplan/00-installer-config.yaml修改

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章