VMWare Fusion 问题全解

笔者趁国补和教育优惠,2999入手了Mac Mini M4,16GB+256GB,放在家里当小主机服务器正好合适。macOS上的虚拟机我选择了VMWare Fusion,个人下载Pro版本是免费的。于是开始了踩坑之旅

1. VMWare Fusion Pro 安装

在官网 https://www.vmware.com/products/desktop-hypervisor/workstation-and-fusion 下载

需要注册Broadcom账号。

2. VMWare Fusion 网络接口问题

⚠️注意!!!千万不要开启ClashX、QuanX、Verge等的VPN、增强模式、TUN模式时打开VMWare Fusion,会导致虚拟网络接口服务异常!
如果要使用,先开启VMWare Fusion,再开启TUN!这个问题卡了我好半天!

如果你已经开启了,建议卸载后重装。

参考这篇文章 https://zhuanlan.zhihu.com/p/614656402

3. Ubuntu arm64 虚拟机镜像问题

由于官方没有提供arm64的Desktop iso镜像,我参考了这个链接,下载了ubuntu-22.04.5-live-server-arm64.iso的服务器镜像。下载地址:https://cdimage.ubuntu.com/releases/jammy/release/

全部选择默认选项安装,安装后再使用 apt 安装桌面

1
2
3
sudo apt install slim -y
sudo apt install ubuntu-desktop -y
sudo reboot

4. Ubuntu arm64 网络问题

安装了桌面后,可以发现设置里的网络没有Wired选项,只有VPN选项。
参考这个链接 https://forum.linuxconfig.org/t/wired-unmanaged-ubuntu-desktop-issue/1574

1
sudo nano /etc/netplan/50-cloud-init.yaml

FROM:

1
2
3
4
5
6
7
8
# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
version: 2
renderer: networkd
ethernets:
enp0s3:
dhcp4: yes

TO:

1
2
3
4
5
6
7
8
# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
version: 2
renderer: NetworkManager
ethernets:
enp0s3:
dhcp4: yes

保存后,执行

1
sudo netplan apply

保存后即可出现Wired选项

⚠️注意!如果按照网上这样设置,重启后会失效!这是因为服务器镜像自动开启了cloud-init,需要把他关闭

1
2
sudo touch /etc/cloud/cloud-init.disabled
reboot

5. 配置虚拟机静态IP

因为我在做Kubernetes集群,所以需要配置静态IP

先去Fusion的设置里添加一个网段,关闭DHCP

https://ohmyimage.pp.ua/1745300223746.png

虚拟机ubuntu中,Setting->Network->Wired 删除默认配置,新增一个配置,IPv4配置为静态IP,按照Fusion的网段配置,网关为Fusion的IP,DNS建议填写公网DNS,如8.8.8.8

https://ohmyimage.pp.ua/1745300514651.png

⚠️注意!网关地址不是10.0.1.1,我这里填写的是10.0.1.2,具体内容可以到Fusion的配置目录里找:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
cd /Library/Preferences/VMware\ Fusion
cat vmnet2/nat.conf
# VMware NAT configuration file
# Manual editing of this file is not recommended. Using UI is preferred.

[host]

# Use MacOS network virtualization API
useMacosVmnetVirtApi = 1

# NAT gateway address
ip = 10.0.1.2
netmask = 255.255.255.0

# VMnet device if not specified on command line
device = vmnet2

# Allow PORT/EPRT FTP commands (they need incoming TCP stream ...)
activeFTP = 1

# Allows the source to have any OUI. Turn this on if you change the OUI
# in the MAC address of your virtual machines.
allowAnyOUI = 1

# VMnet host IP address
hostIp = 10.0.1.1

# Controls if (TCP) connections should be reset when the adapter they are
# bound to goes down
resetConnectionOnLinkDown = 1

# Controls if (TCP) connection should be reset when guest packet's destination
# is NAT's IP address
resetConnectionOnDestLocalHost = 1

# Controls if enable nat ipv6
natIp6Enable = 0

# Controls if enable nat ipv6
natIp6Prefix = fd15:4ba5:5a2b:1002::/64

[tcp]

# Value of timeout in TCP TIME_WAIT state, in seconds
timeWaitTimeout = 30

[udp]

# Timeout in seconds. Dynamically-created UDP mappings will purged if
# idle for this duration of time 0 = no timeout, default = 60; real
# value might be up to 100% longer
timeout = 30

[netbios]
# Timeout for NBNS queries.
nbnsTimeout = 2

# Number of retries for each NBNS query.
nbnsRetries = 3

# Timeout for NBDS queries.
nbdsTimeout = 3

[incomingtcp]

# Use these with care - anyone can enter into your VM through these...
# The format and example are as follows:
#<external port number> = <VM's IP address>:<VM's port number>
#8080 = 172.16.3.128:80

[incomingudp]

# UDP port forwarding example
#6000 = 172.16.3.0:6001