自从苹果(Apple)在个人电脑领域远远落后于微软以来,已经有很长一段时间了。(Microsoft)尽管如此,Windows仍然是最流行的桌面操作系统 (OS)。如果您主要是Windows用户,您可能需要不经常涉足Mac世界。您可以在Windows PC上的虚拟机中安装 macOS,而不是购买MacBook 。
我可以在 Windows 上运行 macOS 吗?(Can I Run macOS on Windows?)
如果您是Windows高级用户,您知道您可以在Hyper-V中运行(Hyper-V)Linux或其他版本的Windows。如果您是Mac高级用户,您知道您可以在 Mac(run Windows on a Mac)上使用Boot Camp或(Boot Camp)VMWare Fusion、Parallels或VirtualBox等虚拟机运行 Windows 。但是,您可以在Windows(Windows)上运行 macOS吗?您可以在 Windows 中的 VMWare 上运行 macOS(run macOS on VMWare in Windows),但使用 VirtualBox 是免费的。
如果您有以下条件,您可以在Windows上的(Windows)VirtualBox中安装 macOS :
- 合法获得的 macOS 副本
- 至少 2 GB 的备用 RAM
- 具有至少 4 个逻辑 CPU 的 64 位CPU(CPUs)
- PC 上的管理员访问权限
幸运的是,今天的许多计算机都超过了最低硬件要求。
获取 macOS 的副本(Get a Copy of macOS)
打开Apple App Store并下载BigSur的副本。它是一个完整的操作系统,因此下载量很大。确保您有足够的空间和时间来下载它。如果您无法从App Store下载 macOS (App Store)BigSur,出于安全原因,我们不建议您使用互联网上的其他版本。
在 Windows 上安装 VirtualBox(Install VirtualBox on Windows)
此过程似乎可以使用的最新版本的VirtualBox是VirtualBox v6.1.26。转到VirtualBox 6.1.26 下载(VirtualBox 6.1.26 download)站点并选择VirtualBox-6.1.26-145957-Win.exe。还要选择VirtualBox 扩展(VirtualBox Extension)包Oracle_VM_VirtualBox_Extension_Pack-6.1.26-145957.vbox-extpack。
- (Install VirtualBox)通过运行下载的安装程序来安装 VirtualBox 。
- VirtualBox安装完成后,安装VirtualBox扩展(VirtualBox)包。
在 VirtualBox 中创建虚拟机(Create a Virtual Machine In VirtualBox)
将创建虚拟机想象为在您的计算机中构建计算机。这为 macOS 提供了自己的安装位置并分配其工作所需的资源。
- 选择新建(New )按钮。
- 在名称(Name)字段中输入虚拟机的名称。一个简单的名称更易于使用,例如macOS。在机器文件夹(Machine Folder)字段中选择 macOS 虚拟机的安装位置。对于多磁盘 PC,请选择至少有 100GB 可用空间的磁盘。如果可能,请选择SSD磁盘。这将有助于性能。或将其保留为默认值。VirtualBox将根据为 VM 输入的名称自动将Type设置为Mac OS X,并将Version设置为Mac OS X(64 位) 。(Mac OS X (64-bit) )
- 在不超过总内存的 50% 的情况下为 macOS VM分配(Allocate)尽可能多的内存。您的 PC 仍然需要资源。
- 确保选择立即创建虚拟硬盘(Create a virtual hard disk now ),然后选择创建(Create )继续。
- 选择硬盘文件类型。默认的VHD很好。或者根据您的需要选择另一个。
- VDI(VirtualBox 磁盘映像)(VDI (VirtualBox Disk Image)):仅适用于VirtualBox。如果您可能将 VM 迁移到另一个 VM 主机,例如Hyper-V或VMWare,请不要选择这个。
- VHD(虚拟硬盘)(VHD (Virtual Hard Disk)):适用于将 VM 迁移到Hyper-V。
- VMDK(虚拟机磁盘)(VMDK (Virtual Machine Disk)):适用于将 VM 迁移到VMWare。
- 如果您在SSD或 nvMe 驱动器上创建 macOS,您可以选择Dynamically(Dynamically allocated) assigned 。SSD 的速度足够快,可以在不影响性能的情况下调整大小。如果您不确定,请选择Fixed size。选择下一步(Next )继续。
- 在文件位置和大小(File location and size)屏幕上,保留默认文件夹路径。至少为虚拟硬盘分配 60 GB。如果您计划安装多个程序或将 macOS 升级到Monterey,请使用至少 100 GB。选择创建(Create )以继续。
- 当 VM 创建过程结束时,选择 macOS VM 并选择“设置”(Settings )按钮。
- 转到System页面,然后转到Motherboard选项卡。在Boot Order字段中取消选中Floppy。使用向上和向下箭头调整引导顺序,使光纤(Optical )排在第一位,硬盘(Hard Disk )排在第二位。其余选项的默认值最好保留原样。
- 移至处理器(Processor )选项卡。将处理器(Processor(s) )调整为至少 2个 CPU(CPUs)。如果您的CPU有 4 个内核和 8 个逻辑处理器,VirtualBox将显示您最多可以使用 8个 CPU(CPUs)。不要使用超过一半。保留执行上限(Execution Cap )为100%并默认选择Enable PAE/NX。选择确定(OK )继续。
- 转到显示(Display )页面,然后转到屏幕(Screen )选项卡。最大显存(Video Memory )为128MB。保留选中此选项卡上其他选项的默认值。
- 进入存储(Storage )页面。选择控制器:SATA(Controller: SATA ),然后选中Use Host I/O Cache 框。然后选择清空(Empty )存储设备。
选择光驱(Optical Drive )字段旁边的 DVD 图标。然后选择选择一个磁盘文件(Choose a disk file)。导航到存储 macOS .iso下载的位置并选择它。选择确定(OK )继续。
- 要完成下一步,请退出VirtualBox。如果您不退出它或它继续作为僵尸进程运行,则下一步将不起作用。您将无法创建 macOS 虚拟机。关闭VirtualBox后,打开任务管理器(Task Manager )并确保未列出该进程。
- 前往 GitHub 并获取VirtualBox macOS 代码(VirtualBox macOS codes)。从那里复制它们并将它们粘贴到记事本(Notepad)中。需要编辑代码以匹配您的 macOS VM 情况。
如果您将VirtualBox安装到与第一行中显示的位置不同的位置,请编辑第一行以匹配。
在其余行中,将您的虚拟机名称(Your Virtual Machine Name)更改为 macOS,即您为该 VM 指定的名称。
- 以管理员(Administrator)身份 打开命令提示符(Command Prompt )。复制第一行代码并输入。这会将命令(Command)提示符中的基本目录更改为安装VirtualBox的位置。然后在命令(Command)提示符 下复制、粘贴和运行每一行。
安装 macOS Big Sur(Install macOS Big Sur)
- 最后一个命令完成后,关闭命令提示符(Command Prompt)并再次打开VirtualBox。选择您的macOS虚拟机并选择Start。
- 您会在黑色背景上看到很多白色文本。这可能需要几分钟。如果白色文本和黑色背景步骤持续超过 15-20 分钟,则可能无法正常工作。您将看到Apple图标和进度条。如果你走到这一步,它可能会起作用。
- 接下来,您将看到语言(Language )屏幕。选择您喜欢的语言并选择下一个箭头以转到 macOS恢复(Recovery)屏幕。
- 选择磁盘工具(Disk Utility)。
- 在Disk Utility屏幕上,选择左栏中的VBOX HARDDISK MEDIA并选择Erase。
- 它会要求您确认是否要删除它。您还需要为卷起一个新名称。任何名字都可以。选择擦除(Erase )以继续。
- 擦除并重命名卷后,选择完成(Done )以继续。
- 关闭“磁盘工具(Disk Utility )”窗口。
- 在恢复(Recovery )屏幕上,选择安装 macOS Big Sur(Install macOS Big Sur ),然后选择继续(Continue)。
- 它要求您再次继续(Continue )。然后它会要求您两次同意软件许可协议 ( SLA )。如果您想继续,请同意。
- 选择要安装 macOS Big Sur的磁盘。只有你的 macOS 磁盘应该显示,所以点击它。然后选择继续(Continue)。
- 它开始安装。屏幕可能会显示大约还剩 12 到 18 分钟。这是不正确的,因为这部分可能需要一个小时。
- 它将进入带有白色文本的黑屏,然后进入带有Apple标志的灰色屏幕,上面写着“还剩不到一分钟……”还剩一分钟多一点。
- 最终,您将看到“选择您的国家或地区(Select Your Country or Region )”屏幕。您现在正在设置新安装的 macOS。通过设置。
- 完成设置后,拍摄新安装状态的快照。如果将来 macOS VM 出现问题,这使您可以轻松地恢复到它。
更改 macOS 虚拟机的分辨率(Change the Resolution of the macOS Virtual Machine)
如果您喜欢比VirtualBox默认更高的分辨率,您也可以这样做。
- 关闭(Shut)macOS 虚拟机并完全退出VirtualBox。
- 以管理员(Administrator)身份打开命令提示符(Command Prompt)。
- 导航到安装VirtualBox的位置。
- 输入以下命令:
VBoxManage setextradata “macOS ” VBoxInternal2/EfiGraphicsResolution 1920×1080
命令的最后一部分,1920×1080 是分辨率。它可以更改为 1280×720、1920×1080、2560×1440、2048×1080、3840×2160、5120×2880 或 7680×4320 支持的任何分辨率。有些可能不适合你。命令完成后,重新启动VirtualBox和您的 macOS 虚拟机以确保更改有效。
在 VirtualBox 中使用 macOS 的技巧(Tips on Using macOS in VirtualBox)
在安装过程中,如果您看到类似禁止停车标志的圆圈斜线,则说明安装无法正常工作。关闭机器,因为等待没有意义。
再次检查以确保您正确应用了VirtualBox代码。完全关闭VirtualBox并在需要时重新应用它们。
如果这不起作用,请更改 VM 设置以使用更少的RAM或CPU(CPUs)。有时 PC 无法跟上更高的设置。
安装完成后,您可以更改 VM 设置以使用更多RAM或CPU(CPUs)来提高性能,只要您不在主机 PC 上执行任何其他操作。
享受您的新 macOS 虚拟机!
How to Install macOS Big Sur in VirtualBox on Windows
It’s been a long time since Apple was a dіstаnt runner-up tо Microsoft in the personal computer world. Still, Windows is the most popular desktop operating system (OS). If you’re primarily a Wіndows usеr, you may need to dip your tоes in the Mac world infrequently. Inѕtead of buyіng a MacBоok, You could install macOS in a virtual machine on your Windows РC.
Can I Run macOS on Windows?
If you’re a Windows power user, you know you can run Linux or other versions of Windows within Hyper-V. If you’re a Mac power user, you know you can run Windows on a Mac with Boot Camp, or a virtual machine like VMWare Fusion, Parallels, or VirtualBox. But, can you run a macOS on Windows? You could run macOS on VMWare in Windows, but using VirtualBox is free.
You can install macOS in VirtualBox on Windows if you have:
- A legally obtained copy of a macOS
- At least 2 GB of spare RAM
- A 64-bit based CPU with at least 4 logical CPUs
- Administrator access on the PC
Fortunately, many computers today exceed the minimum hardware requirements.
Get a Copy of macOS
Open the Apple App Store and download a copy of BigSur. It’s an entire operating system, so it’s a large download. Make sure you’ve got the space and time to download it. If you don’t have access to download macOS BigSur from the App Store, we don’t recommend using other versions found on the internet, for security reasons.
Install VirtualBox on Windows
The newest version of VirtualBox that this process appears to work with is VirtualBox v6.1.26. Go to the VirtualBox 6.1.26 download site and select VirtualBox-6.1.26-145957-Win.exe. Also select the VirtualBox Extension pack Oracle_VM_VirtualBox_Extension_Pack-6.1.26-145957.vbox-extpack.
- Install VirtualBox by running the downloaded installer.
- When the VirtualBox installation is complete, Install the VirtualBox extension pack.
Create a Virtual Machine In VirtualBox
Think of creating a virtual machine as building a computer inside your computer. This gives macOS its own place to install to and allocates the resources it needs to work.
- Select the New button.
- Enter a name for the virtual machine in the Name field. A simple name is easier to work with, like macOS. Select where the macOS virtual machine will be installed in the Machine Folder field. For a multi-disk PC, pick a disk with at least 100GB of free space. If possible, pick an SSD disk. That will help performance. Or leave it as the default. VirtualBox will automatically set the Type to Mac OS X and Version to Mac OS X (64-bit) based on the name entered for the VM.
- Allocate as much memory as possible for the macOS VM without exceeding 50% of total memory. Your PC still needs resources too.
- Ensure that Create a virtual hard disk now is selected and select Create to continue.
- Choose a hard disk file type. The default VHD is good. Or choose another one based on what you need.
- VDI (VirtualBox Disk Image): Only works in VirtualBox. If you might migrate the VM to another VM host like Hyper-V or VMWare, don’t choose this one.
- VHD (Virtual Hard Disk): Good for migrating the VM to Hyper-V.
- VMDK (Virtual Machine Disk): Good for migrating the VM to VMWare.
- If you’re creating the macOS on an SSD or nvMe drive, you can select Dynamically allocated. SSDs are fast enough to resize without affecting performance much. If you’re not certain, choose Fixed size. Select Next to continue.
- On the File location and size screen, leave the default folder path. Allocate a minimum of 60 GB for the virtual hard disk. If you plan on installing several programs or upgrading the macOS to Monterey, use at least 100 GB. Select Create to continue.
- When the VM creation process ends, select the macOS VM and select the Settings button.
- Go to the System page then the Motherboard tab.In the Boot Order field uncheck Floppy. Use the up and down arrows to adjust the boot order so Optical is first, and Hard Disk is second. The defaults for the remaining options are good to leave as is.
- Move to the Processor tab. Adjust Processor(s) to at least 2 CPUs. If your CPU has 4 cores and 8 logical processors, VirtualBox will show that you have up to 8 CPUs to use. Don’t use more than half. Leave Execution Cap at 100% and Enable PAE/NX should be selected by default as well. Select OK to continue.
- Go to the Display page, then the Screen tab. Max out Video Memory to 128MB. Leave the defaults for the other options on this tab selected.
- Go to the Storage page. Select Controller: SATA and then check the Use Host I/O Cache box. Then select the Empty storage device.
Select the DVD icon next to the Optical Drive field. Then select Choose a disk file. Navigate to where you stored the macOS .iso download and select it. Select OK to continue.
- To complete the next step, exit VirtualBox. The next step won’t work if you don’t exit it or it keeps running as a zombie process. You will not be able to create the macOS VM. After closing VirtualBox, open Task Manager and ensure the process is not listed.
- Go to GitHub and get the VirtualBox macOS codes. Copy them from there and paste them into Notepad. The codes will need to be edited to match your macOS VM situation.
If you installed VirtualBox to a location different from what’s shown in the first line, edit the first line to match.
In the remaining lines, change Your Virtual Machine Name to macOS, the name you gave this VM.
- Open the Command Prompt as Administrator. Copy the first line of code and enter it. This will change the base directory in the Command prompt to where you installed VirtualBox. Then copy, paste, and run each line by itself in the Command prompt.
Install macOS Big Sur
- When the last command finishes, close the Command Prompt and open VirtualBox again. Choose your macOS VM and select Start.
- You’ll see a lot of white text on a black background. This can take a few minutes. If the white text and black background step continues for more than 15-20 minutes, it’s probably not going to work. You’ll see the Apple icon and a progress bar. If you get this far, it’s probably going to work.
- Next you’ll see the Language screen. Choose the language you prefer and select the next arrow to go to the macOS Recovery screen.
- Select Disk Utility.
- On the Disk Utility screen, select the VBOX HARDDISK MEDIA in the left column and select Erase.
- It will ask you to confirm that you want to erase it. You need to give the volume a new name, too. Any name will do. Select Erase to continue.
- Once the volume is erased and renamed, select Done to continue.
- Close the Disk Utility window.
- On the Recovery screen, select Install macOS Big Sur and then Continue.
- It asks you to Continue again. Then it will ask you to agree to the software license agreement (SLA) twice. Agree if you want to continue.
- Select the disk to install macOS Big Sur on. Only your macOS disk should be showing so click on that. Then select Continue.
- It starts installing. The screen might say that there’s about 12 to 18 minutes remaining. It’s not correct as this part can take an hour.
- It will go to a black screen with white text, then to a gray screen with the Apple logo that says, “Less than a minute remaining…” There is a lot more than a minute remaining.
- Eventually, you’ll see the Select Your Country or Region screen. You’re now in the setup of your freshly installed macOS. Go through the set up.
- Once you’ve completed the setup, take a snapshot of the freshly installed state. This allows you to revert back to it easily should something go wrong with the macOS VM in the future.
Change the Resolution of the macOS Virtual Machine
If you prefer greater resolution than the VirtualBox default, you can do that too.
- Shut down the macOS virtual machine and completely exit VirtualBox.
- Open the Command Prompt as Administrator.
- Navigate to where VirtualBox is installed.
- Enter the following command:
VBoxManage setextradata “macOS” VBoxInternal2/EfiGraphicsResolution 1920×1080
The last part of the command, 1920×1080 is the resolution. It can be changed to any of 1280×720, 1920×1080, 2560×1440, 2048×1080, 3840×2160, 5120×2880, or 7680×4320 supported resolutions. Some may not work for you though. After the command completes, restart VirtualBox and your macOS VM to make sure the change works.
Tips on Using macOS in VirtualBox
During the install, if you see a circle-slash like a no parking sign, the installation isn’t going to work. Shut the machine down as there’s no sense waiting.
Again, check to ensure that you applied the VirtualBox codes correctly. Completely close VirtualBox and reapply them if needed.
If that doesn’t work, change the VM settings to use less RAM or CPUs. Sometimes the PC can’t keep up with a higher setting.
Once the install is complete, you can change the VM settings to use more RAM or CPUs to increase the performance, as long as you’re not doing anything else on the host PC.
Enjoy your new macOS virtual machine!