jpmorrison / OSX-Qemu

1 stars 0 forks source link

Spice remote-viewer client folder sharing (WebDav) #7

Open jpmorrison opened 2 years ago

jpmorrison commented 2 years ago

Spice remote-viewer supports client folder sharing using WebDav (also used for clipboard).

Qemu

-device virtserialport,chardev=charchannel1,id=channel1,name=org.spice-space.webdav.0 \
-chardev spiceport,name=org.spice-space.webdav.0,id=charchannel1

Guest

MacOS

Update: spice-webdavd - working enough for testing when built with Homebrew. Builds with macports but unusable.

./spice-webdavd -p 9843 &

mount_webdav -S -v 'Client Folder'  http://localhost:9843  /destination/path

Debugging messages may help

G_MESSAGES_DEBUG=all ./spice-webdavd -p 9843

jpmorrison commented 2 years ago

Macports spice-webdavd TL;DR; don't bother, use homebrew.

I am able to build and run phodav using macports for all the dependencies. Avahi seems to conflict so don't install it or disable it meson configure -D avahi=disabled

Once spice-webdavd is running, the client folder can be mounted from command line or Finder.

I have opened the client shared folder with Finder and even managed to copy a file but it stops working. There's no crash, no errors logged it just stops working. Wireshark shows it stops responding after a few PROPFINDS.

jpmorrison commented 2 years ago

Homebrew:

brew install meson ninja glib libsoup icu4c
# make sure /usr/local/lib/pkgconfig/icu-uc.pc exists and fix if it's missing
cd /usr/local/lib/pkgconfig
ln -s ../../Cellar/icu4c/69.1/lib/pkgconfig/icu-uc.p

cd
git clone https://gitlab.gnome.org/jpmorrison/phodav
cd phodav
mkdir build
meson setup -D avahi=disabled build
ninja -C build

This builds with clang if you have Xcode/command line tools. Seems to run better if you install and build gcc. Xcode installs 'gcc' that calls clang by default.

jpmorrison commented 2 years ago

Works better compiled with GCC

git clone https://gitlab.gnome.org/jpmorrison/phodav
cd phodav
mkdir build
CC=gcc-11 meson setup -D avahi=disabled build
ninja -C build
Tom9876 commented 2 years ago

@jpmorrison I tried to follow your directions but alway get an error: meson.build:37:0: ERROR: Dependency "libsoup-2.4" not found, tried pkgconfig, framework and cmake even after "brew install libsoup@2". Do I need a kind of "dev" version? I just started my first steps on macOS and brew Thanks in advance

jpmorrison commented 2 years ago

I installed libsoup but it shows I have 2.7.4.1

Do you have pkg-config?

brew info libsoup
libsoup: stable 2.74.1 (bottled)
HTTP client/server library for GNOME
https://wiki.gnome.org/Projects/libsoup
/usr/local/Cellar/libsoup/2.74.1 (146 files, 2.9MB) *
  Poured from bottle on 2021-11-15 at 02:45:14
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/libsoup.rb
License: LGPL-2.0-or-later
==> Dependencies
Build: gobject-introspection ✘, meson ✔, ninja ✔, pkg-config ✔, vala ✘
Required: glib-networking ✔, gnutls ✔, libpsl ✔
Tom9876 commented 2 years ago

Thanks for the prompt reply. As mentioned "brew install libsoup" installed libsoup v3

brew info libsoup
libsoup: stable 3.0.2 (bottled)
HTTP client/server library for GNOME
https://wiki.gnome.org/Projects/libsoup
/opt/homebrew/Cellar/libsoup/3.0.2 (121 files, 2MB) *
  Poured from bottle on 2021-11-26 at 14:39:14
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/libsoup.rb
License: LGPL-2.0-or-later
==> Dependencies
Build: gobject-introspection ✘, meson ✔, ninja ✔, pkg-config ✔, vala ✘
Required: glib-networking ✔, gnutls ✔, libpsl ✔

I also installed libsoup@2

brew info libsoup@2
libsoup@2: stable 2.74.1 (bottled) [keg-only]
HTTP client/server library for GNOME
https://wiki.gnome.org/Projects/libsoup
/opt/homebrew/Cellar/libsoup@2/2.74.1 (146 files, 2.9MB)
  Poured from bottle on 2021-11-26 at 22:31:56
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/libsoup@2.rb
License: LGPL-2.0-or-later
==> Dependencies
Build: gobject-introspection ✘, meson ✔, ninja ✔, pkg-config ✔, vala ✘
Required: glib-networking ✔, gnutls ✔, libpsl ✔
==> Caveats
libsoup@2 is keg-only, which means it was not symlinked into /opt/homebrew,
because this is an alternate version of another formula.

For compilers to find libsoup@2 you may need to set:
  export LDFLAGS="-L/opt/homebrew/opt/libsoup@2/lib"
  export CPPFLAGS="-I/opt/homebrew/opt/libsoup@2/include"

For pkg-config to find libsoup@2 you may need to set:
  export PKG_CONFIG_PATH="/opt/homebrew/opt/libsoup@2/lib/pkgconfig"

I guess I have to use the above "export" statements. I wasn't aware that "brew info" gives such hints. I will try and let you know. Or dead you have any other advice / hint.

Tom9876 commented 2 years ago

Here my failed approach:

➜  phodav git:(master) export LDFLAGS="-L/opt/homebrew/opt/libsoup@2/lib"
➜  phodav git:(master) export CPPFLAGS="-I/opt/homebrew/opt/libsoup@2/include"
➜  phodav git:(master) export PKG_CONFIG_PATH="/opt/homebrew/opt/libsoup@2/lib/pkgconfig"
➜  phodav git:(master) CC=gcc-11 meson setup -D avahi=disabled build     
The Meson build system
Version: 0.60.2
Source dir: /Users/t1234/phodav
Build dir: /Users/t1234/phodav/build
Build type: native build
Project name: phodav
Project version: 2.5.15-ae9a
C compiler for the host machine: gcc-11 (gcc 11.2.0 "gcc-11 (Homebrew GCC 11.2.0_3) 11.2.0")
C linker for the host machine: gcc-11 ld64 711
Host machine cpu family: aarch64
Host machine cpu: arm64
Program sh found: YES (/bin/sh)
Found pkg-config: /opt/homebrew/bin/pkg-config (0.29.2)
Run-time dependency gio-unix-2.0 found: YES 2.70.1
Found CMake: /opt/homebrew/bin/cmake (3.22.0)
Run-time dependency libsoup-2.4 found: NO (tried framework and cmake)

meson.build:37:0: ERROR: Could not generate cargs for libsoup-2.4:
Package icu-uc was not found in the pkg-config search path.
Perhaps you should add the directory containing `icu-uc.pc'
to the PKG_CONFIG_PATH environment variable
Package 'icu-uc', required by 'libpsl', not found
jpmorrison commented 2 years ago

Is icu4c installed? The .pc file doesn't get installed properly (should mention to the package maintainer) I listed how to fix (https://github.com/jpmorrison/OSX-Qemu/issues/7#issuecomment-951465693) but you may need to change if the version is different.

Example:

cd /usr/local/lib/pkgconfig
ln -s ../../Cellar/icu4c/69.1/lib/pkgconfig/icu-uc.pc

Check pkgconfig for libsoup as well. Is there libsoup-2.4.pc or any other version?

cd /usr/local/lib/pkgconfig
ls -l libsoup-* icu-uc.pc

lrwxr-xr-x  1 501  80  47 Oct 25 15:21 icu-uc.pc -> ../../Cellar/icu4c/69.1/lib/pkgconfig/icu-uc.pc
lrwxr-xr-x  1 501  80  56 Nov 15 02:45 libsoup-2.4.pc -> ../../Cellar/libsoup/2.74.1/lib/pkgconfig/libsoup-2.4.pc
lrwxr-xr-x  1 501  80  62 Nov 15 02:45 libsoup-gnome-2.4.pc -> ../../Cellar/libsoup/2.74.1/lib/pkgconfig/libsoup-gnome-2.4.pc
Tom9876 commented 2 years ago

Thanks for the hint. I have created the link as you proposed, but haven't checked it :(. In my recent (standard) install of brew the Cellar was in "/opt/homebrew". Using ln -s /opt/homebrew/Cellar/icu4c/69.1/lib/pkgconfig/icu-uc.pc worked for me. Even so this is the only link in "/usr/local/lib/pkgconfig", no issue with libsoup not found anymore Thanks again