1. QEMU Guest Agent 共享剪切板
sudo apt install qemu-guest-agent
配置虚拟机
打开 virt-manager,选择 Windows 10 虚拟机,点击 “打开”。
点击 “详细信息” -> “虚拟硬件详情” -> “添加硬件”,选择 “Channel”,在 “目标类型” 中选择 org.qemu.guest_agent.0。
代码: 全选
<channel type="qemu-vdagent">
<source>
<clipboard copypaste="yes"/>
</source>
<target type="virtio" name="org.qemu.guest_agent.0" state="disconnected"/>
<alias name="channel1"/>
<address type="virtio-serial" controller="0" bus="0" port="2"/>
</channel>
注意:尝试过 使用 SPICE 代理安装与配置, 下面这两步, 无法启动成功
sudo systemctl start spice-webdavd
sudo systemctl enable spice-webdavd
提示错误:
代码: 全选
sudo systemctl start spice-webdavd
sudo systemctl enable spice-webdavd
[sudo] ubuntu 的密码:
The unit files have no installation config (WantedBy=, RequiredBy=, UpheldBy=,
Also=, or Alias= settings in the [Install] section, and DefaultInstance= for
template units). This means they are not meant to be enabled or disabled using systemctl.
Possible reasons for having these kinds of units are:
• A unit may be statically enabled by being symlinked from another unit's
.wants/, .requires/, or .upholds/ directory.
• A unit's purpose may be to act as a helper for some other unit which has
a requirement dependency on it.
• A unit may be started when needed via activation (socket, path, timer,
D-Bus, udev, scripted systemctl call, ...).
• In case of template units, the unit is meant to be enabled with some
instance name specified.
sudo apt install virtiofsd
配置虚拟机:在 virt-manager 中,编辑 Windows 10 虚拟机的配置。添加一个新的 “Filesystem” 设备,选择 “VirtioFS” 作为设备类型,将宿主机上要共享的目录(如 /home/ubuntu/Downloads)设置为源路径,为其指定一个挂载标签(如 shared)。
代码: 全选
<filesystem type="mount" accessmode="passthrough">
<driver type="virtiofs"/>
<binary path="/usr/libexec/virtiofsd"/>
<source dir="/home/ubuntu/Downloads"/>
<target dir="Downloads"/>
<alias name="fs0"/>
<address type="pci" domain="0x0000" bus="0x05" slot="0x00" function="0x0"/>
</filesystem>
https://fedorapeople.org/groups/virt/vi ... le-virtio/
下载最新的 VirtIO 驱动,并在 Windows 10 虚拟机中安装。
下面步骤无法成功.
挂载共享目录:打开 “此电脑”,右键点击空白处,选择 “添加一个网络位置”,按照向导操作,选择 “选择自定义网络位置”,输入 \\wsl$\shared(shared 是在宿主机上设置的挂载标签),然后完成挂载