From 5ccfc993f40ab7f0bd6dfd458e41e0b6f4f8c070 Mon Sep 17 00:00:00 2001 From: osy Date: Mon, 18 Nov 2024 01:59:26 -0800 Subject: [PATCH] readme: add notes for macOS --- README.md | 49 ++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 46 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 6ac8d23..cd0592f 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ -Spice agent for Linux -===================== +Spice agent for Linux and macOS +=============================== + +### Linux The spice agent for Linux consists of 2 parts, a daemon spice-vdagentd and a per X-session process spice-vdagent. The daemon gets started in Spice guests @@ -27,7 +29,16 @@ Features: * Limited support for setups with multiple Screens (multiple qxl devices each mapped to their own screen) -## Install +### macOS + +Similar to Linux, the SPICE agent has a LaunchDaemon spice-vdagentd which +handles communication with the console port and a LaunchAgent spice-vdagent +that runs for each logged in user. Note that there is no protection against +one logged in user from snooping another user's clipboard when this is running. + +The macOS agent currently only supports clipboard features. + +## Install (Linux) From inside your virtual machine (e.g., GNOME Boxes), use your guest system’s package manager to install. @@ -38,6 +49,33 @@ For example, if you’re running a Debian/Ubuntu derivative in a VM, use: sudo apt install spice-vdagent ``` +## Build (macOS) + +Currently, you can only build on Apple Silicon Macs with Homebrew installed in +both native and Rosetta. This is because we require GLib installed in both +architectures at the default location. + +>>> + $ /opt/homebrew/bin/brew install glib # arm64 + $ /usr/local/bin/brew install glib # x86_64 +>>> + +Then, you can build the project with Xcode or `xcodebuild` + +>>> + $ xcodebuild archive -scheme vd_agent -archivePath vd_agent.xcarchive +>>> + +Afterwards, you can sign the output and create an installer package with a paid +Apple Developer certificate (Developer ID Application and Developer ID +Installer are both needed). + +>>> + $ ./package_macos.sh vd_agent.xcarchive spice-vdagent-x.yy.pkg +>>> + +You may then wish to notarize it before distributing. + ## How it works All vdagent communications on the guest side run over a single pipe which @@ -53,6 +91,11 @@ Under Linux this virtio serial port has the following name: /dev/virtio-ports/com.redhat.spice.0 >>> +Under macOS this virtio serial port has the following name: +>>> + /dev/tty.com.redhat.spice.0 +>>> + To enable the virtio serial port you need to pass the following params on the qemu cmdline: