{"id":3105,"date":"2025-02-27T19:03:12","date_gmt":"2025-02-27T10:03:12","guid":{"rendered":"https:\/\/h4ck.kr\/?p=3105"},"modified":"2025-02-27T19:03:43","modified_gmt":"2025-02-27T10:03:43","slug":"setup-osx-kvm","status":"publish","type":"post","link":"https:\/\/h4ck.kr\/?p=3105","title":{"rendered":"Setup OSX-KVM"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Reference<\/h2>\n\n\n\n<p><a href=\"https:\/\/github.com\/kholia\/OSX-KVM\/blob\/master\/notes.md\">https:\/\/github.com\/kholia\/OSX-KVM\/blob\/master\/notes.md<\/a><\/p>\n\n\n\n<p><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Install QEMU and other packages.<\/li>\n<\/ul>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"bash\" data-enlighter-theme=\"dracula\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo apt update\n\nsudo apt-get install qemu-system uml-utilities virt-manager git \\\n    wget libguestfs-tools p7zip-full make dmg2img tesseract-ocr \\\n    tesseract-ocr-eng genisoimage vim net-tools screen -y<\/pre>\n\n\n\n<p><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Clone OSX-KVM repository.<\/li>\n<\/ul>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"raw\" data-enlighter-theme=\"dracula\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">cd ~\n\ngit clone --depth 1 --recursive https:\/\/github.com\/kholia\/OSX-KVM.git\n\ncd OSX-KVM<\/pre>\n\n\n\n<p><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Load KVM module, ignores unknown MSR instructions and continues execution.<\/li>\n<\/ul>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"bash\" data-enlighter-theme=\"dracula\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo modprobe kvm; echo 1 | sudo tee \/sys\/module\/kvm\/parameters\/ignore_msrs<\/pre>\n\n\n\n<p>To make this change permanent, you may use the following command.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"bash\" data-enlighter-theme=\"dracula\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo cp kvm.conf \/etc\/modprobe.d\/kvm.conf  # for intel boxes only\n\nsudo cp kvm_amd.conf \/etc\/modprobe.d\/kvm.conf  # for amd boxes only<\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Add user to the&nbsp;<code>kvm<\/code>&nbsp;and&nbsp;<code>libvirt<\/code>&nbsp;groups (might be needed).<\/li>\n<\/ul>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"bash\" data-enlighter-theme=\"dracula\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo usermod -aG kvm $(whoami)\nsudo usermod -aG libvirt $(whoami)\nsudo usermod -aG input $(whoami)<\/pre>\n\n\n\n<p><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Convert the downloaded&nbsp;<code>BaseSystem.dmg<\/code>&nbsp;file into the&nbsp;<code>BaseSystem.img<\/code>&nbsp;file.<br>You can get BaseSystem.dmg by running <code>.\/fetch-macOS-v2.py<\/code> or extract dmg from iso somewhere.<\/li>\n<\/ul>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"bash\" data-enlighter-theme=\"dracula\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">dmg2img -i BaseSystem.dmg BaseSystem.img<\/pre>\n\n\n\n<p><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Create a virtual HDD image where macOS will be installed. If you change the name of the disk image from&nbsp;<code>mac_hdd_ng.img<\/code>&nbsp;to something else, the boot scripts will need to be updated to point to the new image name. <\/li>\n<\/ul>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"bash\" data-enlighter-theme=\"dracula\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">qemu-img create -f qcow2 mac_hdd_ng.img 256G<\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Install with CLI method (primary). Just run the&nbsp;<code>OpenCore-Boot.sh<\/code>&nbsp;script to start the installation process.<\/li>\n<\/ul>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Reference https:\/\/github.com\/kholia\/OSX-KVM\/blob\/master\/notes.md To make this change permanent, you may use the following command.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":0,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":"","footnotes":""},"categories":[1],"tags":[13],"class_list":["post-3105","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-macos"],"_links":{"self":[{"href":"https:\/\/h4ck.kr\/index.php?rest_route=\/wp\/v2\/posts\/3105","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/h4ck.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/h4ck.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/h4ck.kr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/h4ck.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3105"}],"version-history":[{"count":2,"href":"https:\/\/h4ck.kr\/index.php?rest_route=\/wp\/v2\/posts\/3105\/revisions"}],"predecessor-version":[{"id":3107,"href":"https:\/\/h4ck.kr\/index.php?rest_route=\/wp\/v2\/posts\/3105\/revisions\/3107"}],"wp:attachment":[{"href":"https:\/\/h4ck.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3105"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/h4ck.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3105"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/h4ck.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3105"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}