File Sharing
Relevant source files
The following files were used as context for generating this wiki page:
Quickemu provides multiple mechanisms for exchanging files between the host machine and guest virtual machines. These mechanisms are designed to be "optimised" and "just work" based on the guest operating system's capabilities and the host's environment. File sharing is a core feature that supports the project's goal of enabling easy testing and use of over 1000 operating system editions.
The primary file-sharing technologies supported include VirtIO-9p, VirtIO-webdavd, and Samba (SMB/CIFS). The choice of technology often depends on the guest OS type (Linux, macOS, or Windows) and the presence of specific host-side services or guest-side agents.
Sources: README.md:12-16, README.md:46-52
Supported File Sharing Technologies
Quickemu implements three distinct protocols to facilitate file transfers. The system automatically selects or enables these based on the VM configuration and host dependencies.
| Technology | Supported Guest OS | Requirements |
|---|---|---|
| VirtIO-9p | Linux, macOS | Native QEMU support |
| VirtIO-webdavd | Linux, Windows | VirtIO-webdavd drivers/daemons |
| Samba | Linux, macOS, Windows | smbd installed on the host |
Sources: README.md:49-54, AGENTS.md:73
VirtIO-9p and VirtIO-webdavd
VirtIO-based sharing provides high-performance file access by leveraging the VirtIO transport layer.
- VirtIO-9p is primarily used for Linux and macOS guests to mount host directories directly.
- VirtIO-webdavd serves as a modern alternative for Linux and Windows guests, often requiring specific drivers within the guest to interface with the webdavd server provided by the QEMU stack.
Sources: README.md:49-51
Samba Sharing
Samba is a versatile option supported across all major guest types (Linux, macOS, and Windows). It specifically requires the smbd daemon to be present on the host system. In Nix-based development environments, Quickemu is patched to use the specific Samba paths from the Nix store.
Sources: README.md:53-54, AGENTS.md:20-22
Architecture and Data Flow
The following diagram illustrates how Quickemu manages the relationship between the host filesystem and various guest operating systems using different protocols.
The diagram shows the distribution of file-sharing protocols across different guest types and the external dependency on the Samba daemon for SMB-based sharing.
Sources: README.md:49-54, AGENTS.md:20-22
Infrastructure and Configuration
File sharing is integrated into the main quickemu launcher script, which handles the hardware detection and configuration orchestration.
Host Dependencies
To ensure file sharing functions correctly, certain runtime dependencies must be met on the host.
- Samba: Essential for Windows file sharing and general cross-platform compatibility.
- Nix Integration: In development environments using
flake.nixordevshell.nix, thequickemuscript is dynamically patched to ensure it points to the correct Samba binaries within the Nix store rather than relying on global system paths.
Sources: AGENTS.md:20-22, AGENTS.md:73
Implementation Logic
The file sharing logic is part of the broader VM optimisation process where Quickemu "does the right thing" for the user. While quickget downloads the ISOs and creates the initial configuration, the quickemu script interprets these configurations to expose host folders to the guest.
This sequence shows the lifecycle of a VM from creation to file access, highlighting quickemu's role in configuring the sharing backend.
Sources: README.md:21-25, README.md:65-75
Summary
File sharing in Quickemu is designed for maximum compatibility across Linux, macOS, and Windows. By supporting VirtIO-9p, VirtIO-webdavd, and Samba, the project ensures that users can easily move data between the host and guest without manual network configuration. The system relies on host-side tools like smbd and automated hardware detection to provide an "optimised" experience.
Sources: README.md:12-16, README.md:49-54