OSX-KVM: Catalina Install

From wikinotes
OSX-KVM:    "60c2116 (Oct 7th 2019)"
Archlinux:  "Nov-24-2019"

Documentation

github https://github.com/kholia/OSX-KVM
user networking docs https://github.com/kholia/OSX-KVM/blob/master/networking-qemu-kvm-howto.txt
FAQ/Specific-Issue Notes https://github.com/kholia/OSX-KVM/blob/master/notes.md

Install

Firstly, follow instructions here: OSX-KVM: Install Setup

Next, boot qemu and perform installation

./boot-macOS-Catalina.sh
# NOTE: make sure Qemu window is full size
# NOTE: it took me 2x tries to get installer to work

- press Enter to begin install
- choose language
- Disk Utility
  - Erase Target Disk # (QEMU HARDDISK -- mine improperly reported as 134GB)
    - erase
    - partition
       - name partition
       - click the circle on the left
       - click accept
  - Reinstall MacOS
    - continue & wait for install

- Computer will fail to reboot
- re-run ./boot-macOS-Catalina.sh
  - choose to boot from Install, instead of installmedia.

Post Install

Build Bootable ISO


Creates a Bootable MacOS installer ISO. I was under the impression this was required but it was not. Still, very useful for legacy compatibility.

From MacOS guest

1) Download OSX-KVM

- safari: https://github.com/kholia/OSX-KVM
   - clone or download: download zip

2) Download Catalina Installer

- Dock > App Store
- Search: macos catalina
- Get

3) Create ISO

# NOTE: `/Volumes/macOS Base System/Install macOS Catalina.app` is tempting,
#       but MacOS rejects it as a valid installer. Use AppStore version (and param defaults)
./create_iso_catalina.sh

Set Resolution


From linux host

1) Install guestfish

pacaur -S libguestfs

2) Download Clover ISO

- safari: https://sourceforge.net/projects/cloverefiboot/files/Bootable_ISO/
- download: 5070 ISO
cd Downloads
tar -xvf CloverISO-5070.tar.lzma

3) Rebuild Clover disk, with desired resolution

cd ~/Downloads/OSX-KVM-master/Catalina

# set desired resolution (<string>1024x768</string>)
# NOTE: I prefer '1600x900' (1680x1050 still cuts off dock)
vim clover/config.plist.stripped.qemu

# ReBuild CloverNG.qcow2
rm -f CloverNG.qcow2;
sudo ./clover-image-ng.sh \
  --iso ~/Downloads/Clover-v2.5k-5070-X64.iso \
  --cfg clover/config.plist.stripped.qemu \
  --img CloverNG.qcow2

4) Reboot VM, set OVMF resolution to match

# set OVMF Resolution (must match)
- Press ESC during OVMF boot logo (before clover screen)
  - type: exit (press enter)
  - Device Manager > OVMF Platform Configuration > Change Preferred Resolution for Next Boot
  - Save Changes
- re-run ./boot-macOS-Catalina.sh

user-networking (for samba)


This is less performant than tap, but requires no host configuration, and should allow me to mount samba shares like I am used to.

  • MacOS is picky about the virtualized NIC, we're using vmxnet3 . See the networking docs listed above.
  • MacOS refuses to mount samba shares as a guest(nobody). You must authenticate with a samba user/password.
  • Network '10.0.2.4' is unreachable, meaning Qemu's builtin samba share is unavailable. Create your own samba share on the host.

Change your boot-macos-Catalina.sh .

# comment out
`# -netdev tap,id=net0,ifname=tap0,script=no,downscript=no -device vmxnet3,netdev=net0,id=net0,mac=52:54:00:c9:18:27` `# tap-networking (faster, requires host changes)` \

# replace with
-netdev user,id=net0 -device vmxnet3,netdev=net0,id=net0,mac=52:54:00:c9:18:27 `# user-mode netwk (qemu default)` \

Test samba mount from terminal, where you will get better feedback

mkdir ~/tmp
# (on connection error, make sure your samba shares allowed on 10.* ip addrs)
mount_smbfs //smbguest@10.0.2.2/host_share_name ~/tmp

You can also test from the GUI

# NOTE: share only appeared after I mounted from terminal...
- Dock > finder
- (filemenu) Go > Connect to Server
  - '10.0.2.2/external_hdd'


NOTE: spice


spice can be used within the VM (if you want ability to close window).
There is no driver for it, so the mouse remains grabbed, and there is no bi-directional clipboard (whichever route you opt for)

Ultimately I chose not to use it, since Ctrl + Alt + G is easier to repeatedly execute than Shift + F12.

qemu-system-x86_64 \ <br>
      # ===========================
      # (commen tout the following:
      # ===========================
      #-monitor stdio \
      #-vga vmware \
      # =================
      # add the following
      # =================
      -daemonize   `# do not attach monitor, we connect by RDP` \
      -vga qxl \
      -spice port=5930,disable-ticketing \
      -device virtio-serial \
      -device virtserialport,chardev=spicechannel0,name=com.redhat.spice.0 \
      -chardev spicevmc,id=spicechannel0,name=vdagent \
      $*