黑苹果cpu支持列表_单卡gpu直通,黑苹果,amd_cpu教程

编程知识 更新时间:2023-04-27 11:27:37

本文github地址:

Bebove/macos-kvm​github

适用:

amd cpu(intel 也行?)

nvidia 显卡,单卡。

安装黑苹果,(qemu虚拟机),通过pcie硬件直通,完成几乎没有性能损耗的黑苹果虚拟机。

难点:

单卡,ubuntu宿主机器需要关闭xserver释放显卡占用。需要主板支持iommu直通。


step1

  • install ubuntu 18.04. It is important to use the same version of ubuntu.
  • run install_qemu.sh. Which will install qemu4.0.0 for you.
  • Install the vm, provided by //passthroughpo.st//:
cd ~ 
git clone https://github/Bebove/macOS-Simple-KVM 
cd macOS-Simple-KVM 
./jumpstart.sh  #This will download High Sierra. Note that you can speed the download by replace the 1024 by a bigger number in  'macOS-Simple-KVM/tools/FetchMacOS/fetch-macos.py' 
qemu-img create -f qcow2 MyDisk.qcow2 64G
  • adding these 2 lines to the basic.sh script
    -drive id=SystemDisk,if=none,file=MyDisk.qcow2 
    -device ide-hd,bus=sata.4,drive=SystemDisk 

step2

  • run basic.sh,this scripe help you boot the vm.
  • Install the macos to 'MyDisk' normally. (You need to format 'MyDisk' first)

  • When you successfully boot into Macos, you should change the 'ScreenResolution' in clover plist to your display resolution. You may need 'Clover Configurator' to mount EFI,and modify the clover plist.
<key>ScreenResolution</key>
<string>1280x720</string>
  • Also, please change the boot resolution:
Boot your VM, and press escape at the first UEFI dialog. 
Type exit, hit enter. This should bring you to the OVMF configuration menu. 
Navigate to Device Configuration > OVMF Platform Features
and set the resolution to the same value as your VM resolution. 
If you did not change your VM resolution, set it to 1280×720. 
Hit f10, Y, then press escape until you’re in the main dialog. 
hit continue and boot into the VM. Shut it down fully
then Boot again to make sure the change didn’t cause any issues.
  • now, if your vm is working normally, go to step3 to the virt-manager, which will help you add gpu passthrough.

step3

  • Run those lines to install and enable virt-manager.
apt-get install virt-manager -y 
systemctl enable libvirtd.service virtlogd.service 
systemctl start libvirtd.service virtlogd.service
  • Edit the /etc/libvirt/qemu.conf. you must uncomment these two lines:
user="root"    
group="root"

  • and run
systemctl restart libvirtd.service virtlogd.service
  • Download the xml from this repo, edit all the paths in it to your own path!!
  • Now you can change the cpu number of vm. Just change the two '8' in xml:
<vcpu  placement='static'>8</vcpu>
<cpu>
    <topology sockets='1' cores='8' threads='1'/>
  </cpu>
  • Run
virsh define macos.xml
virt-manager
  • Then you can see a gui vm manager. run the macos, it should work fine.
  • Install the nvidia driver within the osx vm. You need to download and install nvidia web driver for your osx verson. Then reboot and shut down.

step4

  • In virt-manager ,you should delete the old mouse/keyboard.
  • Add new mouth/keyboard, which can be added by click 'add hardware --> usb host device'

  • use
lspci -nn |grep NVIDIA

to get the iommu_id of nvidiacard.

  • Download grub in this repo.
  • Delete the /etc/default/grub, and put the grup downloaded in there. Change the:
 vfio-pci.ids=10de:1b81,10de:10f0
  • “10de:1b81,10de:10f0“ in file grup to the iommu_id found by
lspci -nn |grep NVIDIA

  • then reboot your computer.

  • Go into virt-manager, add nvidia card via virt-manager. 'add hardware --> PCI host device' . There are two to add. which may seem like:

  • You can also change the memory of vm in virt-manager.
  • Run
init 3

to kill gui and free the gpu from ubuntu host. Login.

  • Run
cd ~
sudo systemctl enable libvirtd.service virtlogd.service
sudo systemctl start libvirtd.service virtlogd.service
sudo virsh start OSX

更多推荐

黑苹果cpu支持列表_单卡gpu直通,黑苹果,amd_cpu教程

本文发布于:2023-04-20 16:10:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/83986e2eb82dc53e45469f36b026d23e.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:苹果   教程   列表   cpu   gpu

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!

  • 90746文章数
  • 23367阅读数
  • 0评论数