这是我的Vagrantfile
:
Vagrant.configure("2") do |config|
config.vm.box = "ramsey/macos-catalina"
config.vm.define "macosx-test"
config.vm.box_version = "1.0.0"
## NFS needs host-only network
config.vm.network "private_network", ip: "192.168.56.100"
#Ranges: 192.168.56.0/21
config.vm.provider :virtualbox do |virtualbox|
virtualbox.name = "macosx-test"
virtualbox.memory = 4096
virtualbox.cpus = 2
# Show gui, incl. some power
virtualbox.gui = false
# Some needed OSX configs
virtualbox.customize ["modifyvm", :id, "--cpuid-set", "00000001", "000106e5", "00100800", "0098e3fd", "bfebfbff"]
virtualbox.customize ["setextradata", :id, "VBoxInternal/Devices/efi/0/Config/DmiSystemProduct", "MacBookPro11,3"]
virtualbox.customize ["setextradata", :id, "VBoxInternal/Devices/efi/0/Config/DmiSystemVersion", "1.0"]
virtualbox.customize ["setextradata", :id, "VBoxInternal/Devices/efi/0/Config/DmiBoardProduct", "Iloveapple"]
virtualbox.customize ["setextradata", :id, "VBoxInternal/Devices/smc/0/Config/DeviceKey", "ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"]
virtualbox.customize ["setextradata", :id, "VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC", "1"]
# set resolution on OSX:
# 0,1,2,3,4,5 :: 640x480, 800x600, 1024x768, 1280x1024, 1440x900, 1920x1200
virtualbox.customize ["setextradata", :id, "VBoxInternal2/EfiGopMode", "4"]
end
end
当我跑步时vagrant up
,我得到:
如果我打开virtualbox
并打开display
,我会得到:
我怎样才能让它工作?
版本:
$ dpkg -l | grep -E 'vagrant|virtualbox'
ii ruby-vagrant-cloud 3.0.5-1 all Vagrant Cloud API Library
ii vagrant 2.2.19+dfsg-1ubuntu1 all Tool for building and distributing virtualized development environments
ii vagrant-libvirt 0.7.0-1 all Vagrant plugin that adds an Libvirt provider to Vagrant
ii virtualbox 6.1.38-dfsg-3~ubuntu1.22.04.1 amd64 x86 virtualization solution - base binaries
ii virtualbox-dkms 6.1.38-dfsg-3~ubuntu1.22.04.1 amd64 x86 virtualization solution - kernel module sources for dkms
ii virtualbox-qt 6.1.38-dfsg-3~ubuntu1.22.04.1 amd64 x86 virtualization solution - Qt based user interface
已安装扩展包
答案1
解决方法是进行经典安装,然后尝试将所有内容连接在一起(Vagrant <-> VirtualBox)。
有帮助的链接:在 Virtualbox 中制作 Hackintosh。
并且在VirtualBox中创建VM后,需要传递此脚本。
#!/bin/sh
VBoxManage modifyvm "MacOsX" --cpuid-set 00000001 000106e5 00100800 0098e3fd bfebfbff
VBoxManage setextradata "MacOsX" "VBoxInternal/Devices/efi/0/Config/DmiSystemProduct" "iMac11,3"
VBoxManage setextradata "MacOsX" "VBoxInternal/Devices/efi/0/Config/DmiSystemVersion" "1.0"
VBoxManage setextradata "MacOsX" "VBoxInternal/Devices/efi/0/Config/DmiBoardProduct" "Iloveapple"
VBoxManage setextradata "MacOsX" "VBoxInternal/Devices/smc/0/Config/DeviceKey" "ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"
VBoxManage setextradata "MacOsX" "VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC" 1
VBoxManage modifyvm "MacOsX" --cpu-profile "Intel Core i7-6700K"
VBoxManage setextradata "MacOsX" VBoxInternal2/EfiGopMode 4
CPU线"Intel Core i7-6700K"
已添加,未开启维基百科。
LOG:EXITBS:START
没有这条线就被困住了TTY
。
然后,您可以启动VM。享受!