feat: 添加macos系统虚拟机开设的教程
@@ -135,7 +135,8 @@ function getGuideSidebarZhCN() {
|
||||
{ text: 'PVE主体安装', link: '/guide/pve/pve_install.html' },
|
||||
{ text: 'KVM虚拟化', link: '/guide/pve/pve_kvm.html' },
|
||||
{ text: 'LXC虚拟化', link: '/guide/pve/pve_lxc.html' },
|
||||
{ text: '开设Windows虚拟机', link: '/guide/pve/pve_windows.html' },
|
||||
{ text: 'Windows虚拟机', link: '/guide/pve/pve_windows.html' },
|
||||
{ text: 'MacOS虚拟机', link: '/guide/pve/pve_macos.html' },
|
||||
{ text: '自定义', link: '/guide/pve/pve_custom.html' },
|
||||
{ text: '致谢', link: '/guide/pve/pve_thanks.html' },
|
||||
{ text: '常见问题答疑', link: '/guide/pve/pve_qa.html' }
|
||||
@@ -258,6 +259,7 @@ function getGuideSidebarEnUS() {
|
||||
{ text: 'KVM Virtualization', link: '/en/guide/pve/pve_kvm.html' },
|
||||
{ text: 'LXC Virtualization', link: '/en/guide/pve/pve_lxc.html' },
|
||||
{ text: 'Windows Virtual Machine', link: '/en/guide/pve/pve_windows.html' },
|
||||
{ text: 'MacOS Virtual Machine', link: '/en/guide/pve/pve_macos.html' },
|
||||
{ text: 'Custom', link: '/en/guide/pve/pve_custom.html' },
|
||||
{ text: 'Acknowledgements', link: '/en/guide/pve/pve_thanks.html' },
|
||||
{ text: 'FAQ', link: '/en/guide/pve/pve_qa.html' }
|
||||
|
||||
BIN
docs/en/guide/pve/images/mac1.png
Normal file
|
After Width: | Height: | Size: 68 KiB |
BIN
docs/en/guide/pve/images/mac10.png
Normal file
|
After Width: | Height: | Size: 136 KiB |
BIN
docs/en/guide/pve/images/mac11.png
Normal file
|
After Width: | Height: | Size: 62 KiB |
BIN
docs/en/guide/pve/images/mac12.png
Normal file
|
After Width: | Height: | Size: 79 KiB |
BIN
docs/en/guide/pve/images/mac13.png
Normal file
|
After Width: | Height: | Size: 63 KiB |
BIN
docs/en/guide/pve/images/mac14.png
Normal file
|
After Width: | Height: | Size: 65 KiB |
BIN
docs/en/guide/pve/images/mac15.png
Normal file
|
After Width: | Height: | Size: 52 KiB |
BIN
docs/en/guide/pve/images/mac16.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
docs/en/guide/pve/images/mac17.png
Normal file
|
After Width: | Height: | Size: 42 KiB |
BIN
docs/en/guide/pve/images/mac18.png
Normal file
|
After Width: | Height: | Size: 50 KiB |
BIN
docs/en/guide/pve/images/mac19.png
Normal file
|
After Width: | Height: | Size: 43 KiB |
BIN
docs/en/guide/pve/images/mac2.png
Normal file
|
After Width: | Height: | Size: 92 KiB |
BIN
docs/en/guide/pve/images/mac20.png
Normal file
|
After Width: | Height: | Size: 50 KiB |
BIN
docs/en/guide/pve/images/mac21.png
Normal file
|
After Width: | Height: | Size: 466 KiB |
BIN
docs/en/guide/pve/images/mac3.png
Normal file
|
After Width: | Height: | Size: 80 KiB |
BIN
docs/en/guide/pve/images/mac4.png
Normal file
|
After Width: | Height: | Size: 30 KiB |
BIN
docs/en/guide/pve/images/mac5.png
Normal file
|
After Width: | Height: | Size: 126 KiB |
BIN
docs/en/guide/pve/images/mac6.png
Normal file
|
After Width: | Height: | Size: 70 KiB |
BIN
docs/en/guide/pve/images/mac7.png
Normal file
|
After Width: | Height: | Size: 185 KiB |
BIN
docs/en/guide/pve/images/mac8.png
Normal file
|
After Width: | Height: | Size: 118 KiB |
BIN
docs/en/guide/pve/images/mac9.png
Normal file
|
After Width: | Height: | Size: 107 KiB |
@@ -76,7 +76,7 @@ curl -L https://raw.githubusercontent.com/oneclickvirt/pve/main/scripts/buildvm.
|
||||
**Meaning of each parameter**
|
||||
|
||||
```shell
|
||||
./buildvm.sh VMID Username Password Number_of_CPU_Cores Memory Disk SSH_Port Port_80 Port_443 Public_Port_Start Public_Port_End System Storage_Disk Independent_IPV6_address(leave default N blank)
|
||||
# ./buildvm.sh VMID Username Password Number_of_CPU_Cores Memory Disk SSH_Port Port_80 Port_443 Public_Port_Start Public_Port_End System Storage_Disk Independent_IPV6_address(leave default N blank)
|
||||
```
|
||||
|
||||
:::tip
|
||||
@@ -226,7 +226,7 @@ curl -L https://raw.githubusercontent.com/oneclickvirt/pve/main/scripts/buildvm_
|
||||
**Meaning of each parameter**
|
||||
|
||||
```shell
|
||||
./buildvm_extra_ip.sh VMID Username Password Number_of_CPU_Cores Memory_Size_in_MB Disk_Size_in_GB OS Storage_Disk Attach_IPV6(Default is N)
|
||||
# ./buildvm_extra_ip.sh VMID Username Password Number_of_CPU_Cores Memory_Size_in_MB Disk_Size_in_GB OS Storage_Disk Attach_IPV6(Default is N)
|
||||
```
|
||||
|
||||
:::tip
|
||||
@@ -285,7 +285,7 @@ curl -L https://raw.githubusercontent.com/oneclickvirt/pve/main/scripts/buildvm_
|
||||
**Meaning of each parameter**
|
||||
|
||||
```shell
|
||||
./buildvm_manual_ip.sh VMID USERNAME PASSWORD CPU_CORES MEMORY_SIZE_GB STORAGE_SIZE_GB OS STORAGE_DISK IPV4_ADDRESS ATTACH_IPV6(defaults to N) MAC_ADDRESS(Optional whether to specify)
|
||||
# ./buildvm_manual_ip.sh VMID USERNAME PASSWORD CPU_CORES MEMORY_SIZE_GB STORAGE_SIZE_GB OS STORAGE_DISK IPV4_ADDRESS ATTACH_IPV6(defaults to N) MAC_ADDRESS(Optional whether to specify)
|
||||
```
|
||||
|
||||
:::tip
|
||||
@@ -339,7 +339,7 @@ curl -L https://raw.githubusercontent.com/oneclickvirt/pve/main/scripts/buildvm_
|
||||
**Meaning of each parameter**
|
||||
|
||||
```shell
|
||||
./buildvm_fullnat_ip.sh VMID USERNAME PASSWORD CPU_CORES MEMORY_SIZE_GB STORAGE_SIZE_GB OS STORAGE_DISK IPV4_ADDRESS ATTACH_IPV6(defaults to N)
|
||||
# ./buildvm_fullnat_ip.sh VMID USERNAME PASSWORD CPU_CORES MEMORY_SIZE_GB STORAGE_SIZE_GB OS STORAGE_DISK IPV4_ADDRESS ATTACH_IPV6(defaults to N)
|
||||
```
|
||||
|
||||
:::tip
|
||||
@@ -407,7 +407,7 @@ curl -L https://raw.githubusercontent.com/oneclickvirt/pve/main/scripts/buildvm_
|
||||
**Meaning of each parameter**
|
||||
|
||||
```shell
|
||||
./buildvm_onlyv6.sh VMID username password CPU_cores memory_GB disk_GB operating_system storage_disk
|
||||
# ./buildvm_onlyv6.sh VMID username password CPU_cores memory_GB disk_GB operating_system storage_disk
|
||||
```
|
||||
|
||||
:::tip
|
||||
|
||||
@@ -82,7 +82,7 @@ curl -L https://raw.githubusercontent.com/oneclickvirt/pve/main/scripts/buildct.
|
||||
**Meaning of each parameter**
|
||||
|
||||
```shell
|
||||
./buildct.sh CTID Password Number_of_CPU_Cores Memory Disk SSH_Port Port_80 Port_443 Start_Public_Port End_Public_Port System Storage_Disk Independent_IPV6_address(leave default N blank)
|
||||
# ./buildct.sh CTID Password Number_of_CPU_Cores Memory Disk SSH_Port Port_80 Port_443 Start_Public_Port End_Public_Port System Storage_Disk Independent_IPV6_address(leave default N blank)
|
||||
```
|
||||
|
||||
### Test Example
|
||||
|
||||
218
docs/en/guide/pve/pve_macos.md
Normal file
@@ -0,0 +1,218 @@
|
||||
---
|
||||
outline: deep
|
||||
---
|
||||
|
||||
# Setting Up MacOS Virtual Machine
|
||||
|
||||
## Prerequisites
|
||||
|
||||
System and hardware configuration requirements --> Environment detection
|
||||
|
||||
You can only set up a MacOS virtual machine when the environment detection confirms that the host machine supports KVM nested virtualization. Otherwise, it will be detected by hardware and cannot be set up.
|
||||
|
||||
## Setting Up the Prerequisites
|
||||
|
||||
- Automatically identify CPU type (AMD or Intel) and set nested virtualization parameters according to the type.
|
||||
- Modify GRUB boot parameters to enable IOMMU and disable default framebuffer.
|
||||
- Add VFIO module support for hardware device passthrough.
|
||||
- Blacklist sound card and graphics card driver modules to avoid conflicts with macOS.
|
||||
- Configure KVM-related kernel parameters, ignore MSR errors, and improve compatibility.
|
||||
- Patch Proxmox frontend status detection logic to bypass status restrictions.
|
||||
|
||||
```shell
|
||||
curl -L https://raw.githubusercontent.com/oneclickvirt/pve/main/extra_scripts/configure_macos.sh -o configure_macos.sh && chmod +x configure_macos.sh && bash configure_macos.sh
|
||||
```
|
||||
|
||||
After successful execution, it will show that the system will restart in 15 seconds. This is the normal process, as kernel parameters cannot take effect without restarting.
|
||||
|
||||
## System Image Download
|
||||
|
||||
- All images have pre-installed components and are relatively large (minimum about 4.9GB). Download and extraction tasks will run in the background.
|
||||
- Images are complete systems with all components and can be booted and used without internet connection.
|
||||
- If the free space on the system disk is less than twice the size of the image, the download will be rejected.
|
||||
- Images are in 7z compressed format and need to be extracted before use.
|
||||
- You can check the status of current download and extraction tasks at any time. Virtual machines can only be created after completion.
|
||||
|
||||
```shell
|
||||
curl -L https://raw.githubusercontent.com/oneclickvirt/pve/main/scripts/install_macos_images.sh -o install_macos_images.sh && chmod +x install_macos_images.sh && bash install_macos_images.sh
|
||||
```
|
||||
|
||||
Or
|
||||
|
||||
```shell
|
||||
bash install_macos_images.sh
|
||||
```
|
||||
|
||||
After the background download task starts, you can close the SSH window and wait for 30 minutes to 3 hours (depending on your server bandwidth and connectivity) to download the ISO 7z compressed package.
|
||||
|
||||
When the download task is complete and the current download task query shows empty, you can choose to execute the extraction task. The waiting time for extraction depends on your server's CPU performance.
|
||||
|
||||
When the extraction task is complete and the current extraction task query shows empty, all preparations are ready.
|
||||
|
||||
Tasks of the same type can run concurrently, and any task can be canceled at any time by entering the PID value.
|
||||
|
||||
Currently supported image compressed packages:
|
||||
|
||||
```
|
||||
# Listed by system release date from old to new
|
||||
high-sierra.iso.7z (Size: 5.23GB)
|
||||
mojave.iso.7z (Size: 6.03GB)
|
||||
catalina.iso.7z (Size: 8.33GB)
|
||||
big‑sur.iso.7z (Size: 12.21GB)
|
||||
monterey.iso.7z (Size: 12.36GB)
|
||||
ventura.iso.7z (Size: 12.31GB)
|
||||
sonoma.iso.7z (Size: 14.41GB)
|
||||
sequoia.iso.7z (Size: 15.02GB)
|
||||
```
|
||||
|
||||
## MACOS Virtual Machine Template Setup
|
||||
|
||||
- `big‑sur` and newer MACOS systems require at least 6 cores, 6GB memory, and 50GB disk space to set up. Newer system versions (later download sequence numbers) require more hardware resources.
|
||||
- All images are boot disk images without any personal data, so disk allocation, login information setup, and network settings need to be manually configured according to the instructions.
|
||||
- You need to manually start the virtual machine from the web interface. Before starting, you can check if all templates meet your expectations.
|
||||
|
||||
### Download Template Script
|
||||
|
||||
```shell
|
||||
curl -L https://raw.githubusercontent.com/oneclickvirt/pve/main/scripts/build_macos_vm.sh -o build_macos_vm.sh && chmod +x build_macos_vm.sh
|
||||
```
|
||||
|
||||
### Parameter Meanings
|
||||
|
||||
```shell
|
||||
# ./build_macos_vm.sh VMID CPU_cores Memory Disk SSH_port VNC_port System Storage_disk Independent_IPV6(default_N_if_empty)
|
||||
```
|
||||
|
||||
:::tip
|
||||
The disk size here is only the size of the virtual machine's disk. During the actual setup process, the program will also mount the boot disk and system image, so the actual disk requirement for setting up a virtual machine is virtual machine disk size + image size + boot disk size (500MB). Always be aware of whether your disk space is sufficient for setting up virtual machines.
|
||||
:::
|
||||
|
||||
### Example Command
|
||||
|
||||
Using the oldest version (high-sierra) as an example, the supported configuration is as follows (very laggy)
|
||||
|
||||
```shell
|
||||
./build_macos_vm.sh 100 2 4096 45 44022 45901 high-sierra local N
|
||||
```
|
||||
|
||||
After the template is set up, you can run `cat vm100` to view information, or check the NOTES in the corresponding VM in the WEB interface.
|
||||
|
||||
Here is the information for the example VM:
|
||||
|
||||
| Property | Value |
|
||||
|----------------------|---------------|
|
||||
| VMID | 100 |
|
||||
| CPU cores | 2 |
|
||||
| Memory size | 4096MB |
|
||||
| Disk size | 45G |
|
||||
| SSH port | 44022 |
|
||||
| VNC port | 45901 |
|
||||
| System | high-sierra |
|
||||
| Host storage disk | local |
|
||||
| Independent IPV6 | N |
|
||||
|
||||
:::tip
|
||||
Note that VMID can only use numbers from 100 to 256, other numbers are not available
|
||||
:::
|
||||
|
||||
## MACOS System Boot and Installation
|
||||
|
||||
After completing the previous steps, you can see a gray virtual machine waiting to be started in the panel.
|
||||
|
||||
After clicking start, enter the VNC panel. The selection box on the left has a full-screen button. It is recommended to operate in full screen to avoid resolution issues.
|
||||
|
||||
After about 3 minutes of boot disk loading, a startup disk will be displayed on the left center of the screen. Click directly or press Enter.
|
||||
|
||||
After another 3-5 minutes of startup disk loading, four selection boxes will appear. Select `Disk Utility` and click to enter.
|
||||
|
||||

|
||||
|
||||
After entering, you can see three disks and one image. Find the disk larger than 40G named `QEMU HARDDISK Media`, and click `Erase`.
|
||||
|
||||

|
||||
|
||||
A pop-up window will appear, requiring you to rename the `name` to `macos` for easy identification and use later, then click `Erase` to continue initialization.
|
||||
|
||||

|
||||
|
||||
After initialization is complete, click `Done`.
|
||||
|
||||

|
||||
|
||||
Now you need to exit the `Disk Utility` interface. Click `Disk Utility` in the upper right corner and select `Quit Disk Utility` to exit the current selection box.
|
||||
|
||||

|
||||
|
||||
Then you return to the previous four selection boxes. Select `Install macOS XXXX` (since I am using Big Sur as an example, XXXX is Big Sur), and click `continue`.
|
||||
|
||||

|
||||
|
||||
In the following steps, continue clicking `continue`, then click `Agree`, and then `Agree` again.
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
Until those three disks appear again, but here you can see the disk larger than 40G named `macos`. Select it and click `continue`.
|
||||
|
||||

|
||||
|
||||
After a period of file copying and disk loading (about 12 minutes), you will formally enter the system installation phase. Choose your region based on where the host machine is located.
|
||||
|
||||

|
||||
|
||||
After selecting the region, continue clicking `continue`.
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
Until the `Migration Assistant` data migration option appears, select `Not Now` in the lower left corner to not import user data.
|
||||
|
||||

|
||||
|
||||
Then you will be prompted to create a user. Fill in the username, account name, and login password. After setting up, click `continue`.
|
||||
|
||||

|
||||
|
||||
After that, you will continue clicking `continue` until the system installation is complete.
|
||||
|
||||
## Network Configuration
|
||||
|
||||
Since the system installation was performed in an offline environment, you need to manually configure a static network connection to the host's bridge.
|
||||
|
||||
Click the WIFI button in the upper right corner, turn off WIFI, and then click `Network Preferences ...`
|
||||
|
||||

|
||||
|
||||
After entering the settings interface, click the `Advanced` button to enter the advanced settings interface.
|
||||
|
||||

|
||||
|
||||
Fill in the static network configuration in the `TCP/IP` tab.
|
||||
|
||||
Configure IPV4: `Manually`
|
||||
|
||||
IPV4 Address: `172.16.1.xxx` (replace xxx with the IP you want to bind, my vmid is 100, so I wrote 100 for convenience)
|
||||
|
||||
Subnet Mask: `255.255.255.0`
|
||||
|
||||
Router: `172.16.1.1`
|
||||
|
||||
If you need to configure an IPV6 network, similar to the IPV4 settings above, you will need to fill in the public IPV6 address bound to the virtual machine (written in the Note box in the PVE panel), subnet mask 128, and the default gateway obtained by executing `cat /usr/local/bin/pve_check_ipv6` on the host.
|
||||
|
||||

|
||||
|
||||
Fill in the static network DNS configuration in the `DNS` tab.
|
||||
|
||||
Generally, adding `8.8.8.8` and `1.1.1.1` is sufficient. For use in mainland China, use `114.114.114.114`.
|
||||
|
||||

|
||||
|
||||
After filling in and applying, the top left of the settings will show that the network is connected.
|
||||
|
||||

|
||||
|
||||
Now, opening the default browser and visiting any website will allow you to access public network resources, proving that the network has worked.
|
||||
@@ -2,6 +2,8 @@
|
||||
outline: deep
|
||||
---
|
||||
|
||||
# Setting Up Windows Visual Machine
|
||||
|
||||
## Using ISO Image with VirtIO for VM Setup
|
||||
|
||||
### 1. Download the Image
|
||||
|
||||
BIN
docs/guide/pve/images/mac1.png
Normal file
|
After Width: | Height: | Size: 68 KiB |
BIN
docs/guide/pve/images/mac10.png
Normal file
|
After Width: | Height: | Size: 136 KiB |
BIN
docs/guide/pve/images/mac11.png
Normal file
|
After Width: | Height: | Size: 62 KiB |
BIN
docs/guide/pve/images/mac12.png
Normal file
|
After Width: | Height: | Size: 79 KiB |
BIN
docs/guide/pve/images/mac13.png
Normal file
|
After Width: | Height: | Size: 63 KiB |
BIN
docs/guide/pve/images/mac14.png
Normal file
|
After Width: | Height: | Size: 65 KiB |
BIN
docs/guide/pve/images/mac15.png
Normal file
|
After Width: | Height: | Size: 52 KiB |
BIN
docs/guide/pve/images/mac16.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
docs/guide/pve/images/mac17.png
Normal file
|
After Width: | Height: | Size: 42 KiB |
BIN
docs/guide/pve/images/mac18.png
Normal file
|
After Width: | Height: | Size: 50 KiB |
BIN
docs/guide/pve/images/mac19.png
Normal file
|
After Width: | Height: | Size: 43 KiB |
BIN
docs/guide/pve/images/mac2.png
Normal file
|
After Width: | Height: | Size: 92 KiB |
BIN
docs/guide/pve/images/mac20.png
Normal file
|
After Width: | Height: | Size: 50 KiB |
BIN
docs/guide/pve/images/mac21.png
Normal file
|
After Width: | Height: | Size: 466 KiB |
BIN
docs/guide/pve/images/mac3.png
Normal file
|
After Width: | Height: | Size: 80 KiB |
BIN
docs/guide/pve/images/mac4.png
Normal file
|
After Width: | Height: | Size: 30 KiB |
BIN
docs/guide/pve/images/mac5.png
Normal file
|
After Width: | Height: | Size: 126 KiB |
BIN
docs/guide/pve/images/mac6.png
Normal file
|
After Width: | Height: | Size: 70 KiB |
BIN
docs/guide/pve/images/mac7.png
Normal file
|
After Width: | Height: | Size: 185 KiB |
BIN
docs/guide/pve/images/mac8.png
Normal file
|
After Width: | Height: | Size: 118 KiB |
BIN
docs/guide/pve/images/mac9.png
Normal file
|
After Width: | Height: | Size: 107 KiB |
@@ -93,7 +93,7 @@ curl -L https://cdn.spiritlhl.net/https://raw.githubusercontent.com/oneclickvirt
|
||||
**各参数含义**
|
||||
|
||||
```shell
|
||||
./buildvm.sh VMID 用户名 密码 CPU核数 内存 硬盘 SSH端口 80端口 443端口 外网端口起 外网端口止 系统 存储盘 独立IPV6地址(留空默认N)
|
||||
# ./buildvm.sh VMID 用户名 密码 CPU核数 内存 硬盘 SSH端口 80端口 443端口 外网端口起 外网端口止 系统 存储盘 独立IPV6地址(留空默认N)
|
||||
```
|
||||
|
||||
:::tip
|
||||
@@ -264,7 +264,7 @@ curl -L https://cdn.spiritlhl.net/https://raw.githubusercontent.com/oneclickvirt
|
||||
**各参数含义**
|
||||
|
||||
```shell
|
||||
./buildvm_extra_ip.sh VMID 用户名 密码 CPU核数 内存大小以MB计算 硬盘大小以GB计算 系统 存储盘 独立IPV6(默认为N)
|
||||
# ./buildvm_extra_ip.sh VMID 用户名 密码 CPU核数 内存大小以MB计算 硬盘大小以GB计算 系统 存储盘 独立IPV6(默认为N)
|
||||
```
|
||||
|
||||
:::tip
|
||||
@@ -331,7 +331,7 @@ curl -L https://cdn.spiritlhl.net/https://raw.githubusercontent.com/oneclickvirt
|
||||
**各参数含义**
|
||||
|
||||
```shell
|
||||
./buildvm_manual_ip.sh VMID 用户名 密码 CPU核数 内存大小以MB计算 硬盘大小以GB计算 系统 存储盘 IPV4地址 独立IPV6(默认为N) MAC地址(不提供时将不指定虚拟机的MAC地址)
|
||||
# ./buildvm_manual_ip.sh VMID 用户名 密码 CPU核数 内存大小以MB计算 硬盘大小以GB计算 系统 存储盘 IPV4地址 独立IPV6(默认为N) MAC地址(不提供时将不指定虚拟机的MAC地址)
|
||||
```
|
||||
|
||||
:::tip
|
||||
@@ -394,7 +394,7 @@ curl -L https://cdn.spiritlhl.net/https://raw.githubusercontent.com/oneclickvirt
|
||||
**各参数含义**
|
||||
|
||||
```shell
|
||||
./buildvm_fullnat_ip.sh VMID 用户名 密码 CPU核数 内存大小以MB计算 硬盘大小以GB计算 系统 存储盘 IPV4地址 独立IPV6(默认为N)
|
||||
# ./buildvm_fullnat_ip.sh VMID 用户名 密码 CPU核数 内存大小以MB计算 硬盘大小以GB计算 系统 存储盘 IPV4地址 独立IPV6(默认为N)
|
||||
```
|
||||
|
||||
:::tip
|
||||
@@ -469,7 +469,7 @@ curl -L https://cdn.spiritlhl.net/https://raw.githubusercontent.com/oneclickvirt
|
||||
**各参数含义**
|
||||
|
||||
```shell
|
||||
./buildvm_onlyv6.sh VMID 用户名 密码 CPU核数 内存大小以MB计算 硬盘大小以GB计算 系统 存储盘
|
||||
# ./buildvm_onlyv6.sh VMID 用户名 密码 CPU核数 内存大小以MB计算 硬盘大小以GB计算 系统 存储盘
|
||||
```
|
||||
|
||||
:::tip
|
||||
|
||||
@@ -89,7 +89,7 @@ curl -L https://cdn.spiritlhl.net/https://raw.githubusercontent.com/oneclickvirt
|
||||
**各参数含义**
|
||||
|
||||
```shell
|
||||
./buildct.sh CTID 密码 CPU核数 内存 硬盘 SSH端口 80端口 443端口 外网端口起 外网端口止 系统 存储盘 独立IPV6(默认为N)
|
||||
# ./buildct.sh CTID 密码 CPU核数 内存 硬盘 SSH端口 80端口 443端口 外网端口起 外网端口止 系统 存储盘 独立IPV6(默认为N)
|
||||
```
|
||||
|
||||
### 测试示例
|
||||
@@ -235,7 +235,7 @@ curl -L https://cdn.spiritlhl.net/https://raw.githubusercontent.com/oneclickvirt
|
||||
**各参数含义**
|
||||
|
||||
```shell
|
||||
./buildct_onlyv6.sh CTID 密码 CPU核数 内存大小以MB计算 硬盘大小以GB计算 系统 存储盘
|
||||
# ./buildct_onlyv6.sh CTID 密码 CPU核数 内存大小以MB计算 硬盘大小以GB计算 系统 存储盘
|
||||
```
|
||||
|
||||
#### 创建示例
|
||||
|
||||
@@ -2,18 +2,44 @@
|
||||
outline: deep
|
||||
---
|
||||
|
||||
# 开设MacOS虚拟机
|
||||
|
||||
## 前置需求
|
||||
|
||||
系统和硬件配置要求 --> 检测环境
|
||||
|
||||
只有检测环境检测出宿主机支持KVM嵌套虚拟化时,才可以开设MACOS虚拟机,否则会被识别无法开设
|
||||
只有检测环境检测出宿主机支持KVM嵌套虚拟化时,才可以开设MACOS虚拟机,否则会被硬件识别无法开设。
|
||||
|
||||
## 前置环境设置
|
||||
|
||||
- 自动识别 CPU 类型(AMD 或 Intel),并根据类型设置嵌套虚拟化参数。
|
||||
- 修改 GRUB 启动参数,启用 IOMMU 和禁用默认 framebuffer。
|
||||
- 添加 VFIO 模块支持,便于直通硬件设备。
|
||||
- 黑名单声卡和显卡驱动模块,避免与 macOS 冲突。
|
||||
- 配置 KVM 相关内核参数,忽略 MSR 错误,提高兼容性。
|
||||
- 修补 Proxmox 前端状态检测逻辑,绕过状态限制。
|
||||
|
||||
国际
|
||||
|
||||
```shell
|
||||
curl -L https://raw.githubusercontent.com/oneclickvirt/pve/main/extra_scripts/configure_macos.sh -o configure_macos.sh && chmod +x configure_macos.sh && bash configure_macos.sh
|
||||
```
|
||||
|
||||
国内
|
||||
|
||||
```shell
|
||||
curl -L https://cdn.spiritlhl.net/https://raw.githubusercontent.com/oneclickvirt/pve/main/extra_scripts/configure_macos.sh -o configure_macos.sh && chmod +x configure_macos.sh && bash configure_macos.sh
|
||||
```
|
||||
|
||||
执行成功后会显示15秒后重启本机,这是正常的流程,不重启无法使得内核参数生效。
|
||||
|
||||
## 系统镜像下载
|
||||
|
||||
- 所有镜像均预下载安装了启动所需的所有组件,所以非常大,最小都有4.9G
|
||||
- 由于是完整的镜像不是Recovery镜像,所以无需联网下载组件即可直接引导使用
|
||||
- 由于镜像本体较大,所以宿主机的系统盘需要足够大,如果检测到空闲空间比镜像大小的2倍空间还少,那么不予下载
|
||||
- 由于镜像经过7z压缩,所以下载后不能直接使用,需要命令选择解压后使用
|
||||
- 所有镜像已预装组件,体积较大(最小约4.9GB),下载与解压任务将后台挂起执行。
|
||||
- 镜像为完整系统含所有组件,无需联网即可引导使用。
|
||||
- 若系统盘空闲空间不足镜像大小的2倍,将拒绝下载。
|
||||
- 镜像为7z压缩格式,下载后需解压才能使用。
|
||||
- 可随时查看当前下载与解压任务状态,完成后方可创建虚拟机。
|
||||
|
||||
国际
|
||||
|
||||
@@ -32,3 +58,191 @@ curl -L https://cdn.spiritlhl.net/https://raw.githubusercontent.com/oneclickvirt
|
||||
```shell
|
||||
bash install_macos_images.sh
|
||||
```
|
||||
|
||||
后台下载任务挂起执行后,可关闭SSH窗口,等待半小时到3个小时(具体等待时间取决于你的服务器带宽大小和连通性),下载iso的7z压缩包。
|
||||
|
||||
下载任务执行完毕后,查询显示当前下载任务为空时,就可以选择解压任务执行了,解压挂起执行等待的时间取决于你的服务器CPU性能。
|
||||
|
||||
当解压任务执行完毕,查询显示当前解压任务为空时,一切准备工作就算准备好了。
|
||||
|
||||
相同类型的任务可以并发,也可以随时取消某个任务,取消时需要输入PID的值。
|
||||
|
||||
目前支持的镜像压缩包:
|
||||
|
||||
```
|
||||
# 按系统发布时间从旧到新
|
||||
high-sierra.iso.7z (大小: 5.23GB)
|
||||
mojave.iso.7z (大小: 6.03GB)
|
||||
catalina.iso.7z (大小: 8.33GB)
|
||||
big‑sur.iso.7z (大小: 12.21GB)
|
||||
monterey.iso.7z (大小: 12.36GB)
|
||||
ventura.iso.7z (大小: 12.31GB)
|
||||
sonoma.iso.7z (大小: 14.41GB)
|
||||
sequoia.iso.7z (大小: 15.02GB)
|
||||
```
|
||||
|
||||
## MACOS虚拟机模板设置
|
||||
|
||||
- ```big‑sur```及更新版本的MACOS系统需要至少6核6G内存50G硬盘进行开设,系统版本越新(下载的序号越靠后)所需的硬件就越多
|
||||
- 所有镜像均为启动盘镜像,未设置任何个人数据,所以关于硬盘分配,登录信息设置,网络设置都需要后续按照说明手动设置
|
||||
- 需要手动在web端启动虚拟机,启动前可以查看所有模板是否符合预期再启动
|
||||
|
||||
### 下载模板脚本
|
||||
|
||||
国际
|
||||
|
||||
```shell
|
||||
curl -L https://raw.githubusercontent.com/oneclickvirt/pve/main/scripts/build_macos_vm.sh -o build_macos_vm.sh && chmod +x build_macos_vm.sh
|
||||
```
|
||||
|
||||
国内
|
||||
|
||||
```shell
|
||||
curl -L https://cdn.spiritlhl.net/https://raw.githubusercontent.com/oneclickvirt/pve/main/scripts/build_macos_vm.sh -o build_macos_vm.sh && chmod +x build_macos_vm.sh
|
||||
```
|
||||
|
||||
### 参数含义
|
||||
|
||||
```shell
|
||||
# ./build_macos_vm.sh VMID CPU核数 内存 硬盘 SSH端口 VNC端口 系统 存储盘 独立IPV6(留空默认N)
|
||||
```
|
||||
|
||||
:::tip
|
||||
这块的硬盘大小只是你开设的虚拟机的硬盘大小,实际开设过程中,程序还会挂载引导盘和系统镜像,所以实际开设一个虚拟机的硬盘需求是 虚拟机硬盘大小+镜像本体大小+引导盘大小(500MB) 请时刻注意你的硬盘空间是否足够开设虚拟机
|
||||
:::
|
||||
|
||||
### 示例命令
|
||||
|
||||
以最旧的版本(high-sierra)为例,实验支持的配置如下(非常卡顿)
|
||||
|
||||
```shell
|
||||
./build_macos_vm.sh 100 2 4096 45 44022 45901 high-sierra local N
|
||||
```
|
||||
|
||||
模板开设完毕可执行```cat vm100```查看信息,或到WEB端对应VM的NOTES中查看
|
||||
|
||||
以下为开设的示例VM的信息:
|
||||
|
||||
| 属性 | 值 |
|
||||
|-------------------------|----------------|
|
||||
| VMID | 100 |
|
||||
| CPU核数 | 2 |
|
||||
| 内存大小 | 4096MB |
|
||||
| 磁盘大小 | 45G |
|
||||
| SSH端口 | 44022 |
|
||||
| VNC端口 | 45901 |
|
||||
| 系统 | high-sierra |
|
||||
| 宿主机的存储盘 | local |
|
||||
| 绑定独立IPV6(留空默认N) | N |
|
||||
|
||||
:::tip
|
||||
注意这里的VMID仅可使用100到256,其他数字不可用
|
||||
:::
|
||||
|
||||
## MACOS系统引导和安装
|
||||
|
||||
前面的流程走完后,面板端可以看到一个灰色的虚拟机待启动
|
||||
|
||||
点击启动后,进入VNC面板,左侧选择框有一个全屏按钮,实际操作时建议全屏操作,避免分辨率问题
|
||||
|
||||
经过大概3分钟的引导盘加载后,屏幕中央靠左侧会显示有一个启动盘可用,直接点击或回车
|
||||
|
||||
然后又是大概3~5分钟的启动盘加载后,会出现四个选择框,选择```Disk Utility```点击进入
|
||||
|
||||

|
||||
|
||||
进入后可以看到有三个盘和一个镜像,找到那个盘大小大于40G且名字叫```QEMU HARDDISK Media```的盘,点击```Erase```
|
||||
|
||||

|
||||
|
||||
此时会出现一个弹窗,需要给```name```重命名为```macos```方便后续识别使用,然后点击```Erase```继续初始化
|
||||
|
||||

|
||||
|
||||
初始化完毕后,点击```Done```
|
||||
|
||||

|
||||
|
||||
此时需要退出```Disk Utility```界面,右上角点击```Disk Utility```选择```Quit Disk Utility```退出当前选择框
|
||||
|
||||

|
||||
|
||||
然后回到了之前那四个选择框那里,选择```Install macOS XXXX```(由于我在以Big Sur为示例安装,所以XXXX为Big Sur系统),点击```continue```
|
||||
|
||||

|
||||
|
||||
后续就是继续点击```continue```,然后点击```Agree```,然后又是点击```Agree```
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
直到又出现那三个盘,但在这块可以那个盘大小大于40G且名字叫```macos```的盘,选择它,然后点击```continue```
|
||||
|
||||

|
||||
|
||||
一段时间的文件复制硬盘加载(大概跑个12分钟)后,正式进入系统安装环节,这块看你宿主机在哪个地区选哪个
|
||||
|
||||

|
||||
|
||||
选择完地区后一路点击```continue```
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
直到出现数据迁移选项```Migration Assistant```,选择左下角的```Not Now```不导入用户数据
|
||||
|
||||

|
||||
|
||||
然后就会提示你创建用户,填写用户名和账户名,还有登录所需的密码,设置完毕后点击```continue```
|
||||
|
||||

|
||||
|
||||
然后后面就会一路畅通点击```continue```,直到系统安装完毕了
|
||||
|
||||
## 网络配置
|
||||
|
||||
由于是离线环境进行的系统安装,所以这块需要手动配置静态网络连接宿主机的网桥
|
||||
|
||||
右上角点击WIFI按钮,关闭WIFI后,点击```Network Preferences ...```
|
||||
|
||||

|
||||
|
||||
进入设置界面后,点击```Advanced```按钮,进入高级设置界面
|
||||
|
||||

|
||||
|
||||
在```TCP/IP```这一栏填写静态网络配置
|
||||
|
||||
Configure IPV4: ```Manually```
|
||||
|
||||
IPV4 Address: ```172.16.1.xxx```(xxx换成你想绑定的ip,我的vmid是100,为了方便写了100)
|
||||
|
||||
Subnet Mask: ```255.255.255.0```
|
||||
|
||||
Router: ```172.16.1.1```
|
||||
|
||||
如果你需要配置IPV6网络,类比上面的IPV4设置,需要填写的会是虚拟机绑定的公网IPV6地址(PVE面板中的Note框有写),子网掩码填128,默认网关填写```cat /usr/local/bin/pve_check_ipv6```在宿主机执行后显示的地址。
|
||||
|
||||

|
||||
|
||||
在```DNS```这一栏填写静态网络的DNS配置
|
||||
|
||||
一般加入```8.8.8.8```和```1.1.1.1```足够了,中国境内使用```114.114.114.114```即可。
|
||||
|
||||

|
||||
|
||||
填写完毕且```apply```后,设置的左上角会显示网络已连通
|
||||
|
||||

|
||||
|
||||
此时打开默认的浏览器,随便打开一个网址,都是可访问公网资源的,证明网络已配置成功
|
||||
|
||||

|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
outline: deep
|
||||
---
|
||||
|
||||
# 开设Windows虚拟机
|
||||
|
||||
## 开设时选择KVM虚拟化还是QEMU的TCG仿真
|
||||
|
||||
宿主机本身如果支持嵌套虚拟化,那么就可用```host```或```kvm64```或```qemu64```类型的CPU
|
||||
@@ -16,13 +18,13 @@ outline: deep
|
||||
|
||||

|
||||
|
||||
如果你实在不清楚本机是否支持嵌套虚拟化,那么
|
||||
如果你实在不清楚本机是否支持嵌套虚拟化,那么查看 系统与硬件配置要求 --> 检测环境 检测确保可用(含尝试性启用功能)
|
||||
|
||||
借鉴
|
||||
它的主体逻辑在
|
||||
|
||||
<https://cdn.spiritlhl.net/https://raw.githubusercontent.com/oneclickvirt/pve/main/scripts/check_kernal.sh>
|
||||
|
||||
这块的逻辑,主要检测
|
||||
这块的逻辑中,主要检测
|
||||
|
||||
```egrep -c '(vmx|svm)' /proc/cpuinfo``` 检测是否为1
|
||||
|
||||
@@ -30,7 +32,7 @@ outline: deep
|
||||
|
||||
```lsmod | grep -q kvm```检测是否已加载
|
||||
|
||||
这些都支持的时候,才可选```host```类型
|
||||
这些都支持的时候,才可选```host```类型。
|
||||
|
||||
## 使用带virtio的iso镜像文件开设
|
||||
|
||||
|
||||