Initialize shared directory with SPICE WebDAV

Install Dependencies

SPICE guest tools

See SPICE guest tools

SPICE WebDAV

SPICE WebDAV is required for QEMU directory sharing as an alternative to VirtFS.

Since we’re on ArchLinux, we should run the following command:

1
sudo pacman -S phodav

Now we should want to visit the shared directory.

Normally, it is exposed as a WebDAV mount on the guest’s localhost (typically on port 9843).

To access it, we need a browser.

Firefox

I don’t have one yet, so I’ll Install Firefox via yay.

1
yay -S firefox

Before we move on, let’s configure the DISPLAY environment variable first. Again, I need to install one:

1
2
3
sudo pacman -S xorg xorg-xinit xfce4

# Once installation is complete, `reboot` and log-back-in

Before we proceed, make sure to check the following conditions:

X Window System is actually running: You can start the X Window System by running the command startx in a terminal window.

You have permission to access the X Window System: You may need to add your user account to the video group by running the command sudo usermod -aG video <username>.

X Window System is configured to allow remote connections: You may need to edit the /etc/X11/xinit/xserverrc file to include the -listen tcp option. For example, you can add the line exec /usr/bin/X -listen tcp to the file.


We may face some problems when we run startx because X server requires some sort of display device or screen so that it can display graphical output, and since ArchLinux is text-based, we’ll have to go through a few extra steps.

  • Run sudo pacman -S xf86-video-fbdev to install the xf86-video-fbdev package. This package provides a generic framebuffer driver that can be used in place of a specific display driver.

  • Edit the /etc/X11/xorg.conf.d/10-monitor.conf file to specify the fbdev driver. We can do this by adding the following lines to the file:

1
2
3
4
Section "Device"
Identifier "fbdev"
Driver "fbdev"
EndSection

That should do the trick when we run startx again.

If the X server still fails to start, you may need to investigate further by checking the /var/log/Xorg.0.log file for additional information about the error.


After double-checking the conditions listed above, we can now run the command export DISPLAY=:0 to set the display environment variable to the default value for the X Window System.

At last we launch Firefox and navigate to http://127.0.0.1:9843.

1
firefox http://127.0.0.1:9843

We can also try running Firefox with the --no-remote option. This option tells Firefox to open a new instance of the browser, rather than connecting to an existing instance.

1
firefox --no-remote http://127.0.0.1:9843

If the SPICE WebDAV service is running correctly, you should be able to see the page in the Firefox browser window.

Headless browser

Puppeteer

See here

i2pdbrowser

Clone this repo:

1
git clone https://github.com/PurpleI2P/i2pdbrowser.git

Navigate to the README.md file for more information