Merge pull request #28549 from geekpi/translating

translated
This commit is contained in:
geekpi 2023-02-03 08:42:19 +08:00 committed by GitHub
commit f4e842d0a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 119 additions and 119 deletions

View File

@ -1,119 +0,0 @@
[#]: subject: "Share Folder Between Guest and Host in GNOME Boxes"
[#]: via: "https://www.debugpoint.com/share-folder-gnome-boxes/"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Share Folder Between Guest and Host in GNOME Boxes
======
**Use the below steps to share a folder between host and guest in GNOME Boxes app.**
GNOME Boxes is a front-end application to create and manage virtual machines. It is primarily compatible with the GNOME desktop. However, you can use it in other desktop environments, such as KDE Plasma and others.
At the backend, it uses QEMU, KVM, and libvirt tech and provides an easy-to-use user interface to manage multiple virtual machines.
If you want to learn more, you can also refer to [these guides][1] on GNOME Boxes to create virtual machines.
In the prior articles, we have explained how to share folders in [virt-manager][2] and [VirtualBox][3]. And the following steps explain the same for GNOME Boxes.
### How to share folder and file in GNOME Boxes
GNOME Boxes primarily support [SPICE protocol][4] to enable remote access, sharing and many virtualization features. SPICE is one of the oldest open-source packages in the virtualization space.
#### 1. Initial setup
- Firstly, make sure to install the following spice packages inthe **guest system**.
```
sudo apt install spice-vdagent spice-webdavd #for Ubuntu-based distros
sudo dnf install spice-vdagent spice-webdavd #Fedora, RHEL, etc
pacman -S --needed spice spice-gtk spice-protocol spice-vdagent #Arch Linux (optional)
```
- After you install the above, **reboot** the host and guest systems.
- In the host system (for GNOME desktop), open settings and go to Sharing panel.
- **Enable Sharing** using the top toggle button.
- Then, click on File Sharing and **Enable File Sharing**. Make sure to enable the network. The password is optional. If you want to enable password-based authentication for your shared folder, enable it.
![Enable sharing in settings][5]
![Enable File Sharing][6]
- Close the settings window.
- Open GNOME Boxes. Right-click on the VM and select **preferences**.
- Click on **Devices and Shares** on the preference window and click on the **[+] button** under Shared folders.
- Under **Local Folder**: Select the folder from your host you want to access inside the guest.
- **Name**: Give any name you want. This name will be visible in the guests file manager.
- Click Save.
![Add a share folder in host][7]
#### 2. Setup for guest
- Start your guest virtual machine.
- Inside the guest virtual machine, open the file manager. If you are using a GNOME desktop, open Nautilus (i.e. Files).
- Click on **Other Locations**. you should see the “**Spice client folder**” under Networks.
- Double-click on this, and you should see the folder contents of your host system.
- Sometimes, the above folder takes some time to appear. if it is not visible, wait for 1 or 2 minutes. Refresh the file manager window via `F5`.
![Spice client folder in guest][8]
#### 3. Some troubleshooting
- Furthermore, if you are getting the following error, then you need to access the path manually.
```
Unable to access location - HTTP Error: Could not connect: Connection refused
```
![error while accessing the spice client folder][9]
- Press `CTRL+L` in the file manager to bring up the address bar. In the address bar, type the following:
```
dav://localhost:9843
```
- And hit enter. And you should see the folder contents. The `dav` protocol is used by the SPICE server, which connects the guest and host at port 9843.
![accessing via dav protocol][10]
And thats it. Now you can enjoy file sharing between guests and hosts in GNOME Boxes.
Heres a screenshot of the same folder accessed by the guest and host.
![Share folder and its contents between guest and host in GNOME Boxes (sample)][11]
If you run into any error, drop a comment below.
[_Some references are used in this article from GitLab._][12]
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/share-folder-gnome-boxes/
作者:[Arindam][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.debugpoint.com/author/admin1/
[b]: https://github.com/lkxed
[1]: https://www.debugpoint.com/tag/boxes
[2]: https://www.debugpoint.com/share-folder-virt-manager/
[3]: https://www.debugpoint.com/share-folder-between-host-guest-virtualbox/
[4]: https://www.spice-space.org/index.html
[5]: https://www.debugpoint.com/wp-content/uploads/2023/01/Enable-sharing-in-settings.jpg
[6]: https://www.debugpoint.com/wp-content/uploads/2023/01/Enable-File-Sharing.jpg
[7]: https://www.debugpoint.com/wp-content/uploads/2023/01/Add-a-share-folder-in-host.jpg
[8]: https://www.debugpoint.com/wp-content/uploads/2023/01/Spice-client-folder-in-guest.jpg
[9]: https://www.debugpoint.com/wp-content/uploads/2023/01/error-while-accessing-the-spice-client-folder.jpg
[10]: https://www.debugpoint.com/wp-content/uploads/2023/01/accessing-via-dav-protocol.jpg
[11]: https://www.debugpoint.com/wp-content/uploads/2023/01/Share-folder-and-its-contents-between-guest-and-host-in-GNOME-Boxes-sample.jpg
[12]: https://gitlab.gnome.org/GNOME/gnome-boxes/-/issues/430

View File

@ -0,0 +1,119 @@
[#]: subject: "Share Folder Between Guest and Host in GNOME Boxes"
[#]: via: "https://www.debugpoint.com/share-folder-gnome-boxes/"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
在 GNOME Boxes 里的客户机和宿主机之间共享文件夹
======
**使用下面的步骤在 GNOME Boxes 应用中的宿主机和客户机之间共享一个文件夹**。
GNOME Boxes 是一个创建和管理虚拟机的前端应用。它主要与 GNOME 桌面兼容。然而,你可以在其他桌面环境中使用它,如 KDE Plasma 和其他环境。
在后端,它使用 QEMU、KVM 和 libvirt 技术,并提供一个易于使用的用户界面来管理多个虚拟机。
如果你想了解更多,你也可以参考关于 GNOME Boxes 创建虚拟机的[这些指南][1]。
在之前的文章中,我们已经解释了如何在 [virt-manager][2] 和 [VirtualBox][3] 中共享文件夹。而下面的步骤也解释了 GNOME Boxes 的情况。
### 如何在 GNOME Boxes 中共享文件夹和文件
GNOME Boxes 主要支持 [SPICE 协议][4]来实现远程访问、共享和许多虚拟化功能。SPICE 是虚拟化领域中最古老的开源包之一。
#### 1. 初始设置
- 首先,确保在**客户机系统中安装以下 spice 软件包**。
```
sudo apt install spice-vdagent spice-webdavd #for Ubuntu-based distros
sudo dnf install spice-vdagent spice-webdavd #Fedora, RHEL, etc
pacman -S --needed spice spice-gtk spice-protocol spice-vdagent #Arch Linux (optional)
```
- 在你安装完上述内容后,**重启**宿主机和客户机系统。
- 在宿主机系统中(对于 GNOME 桌面),打开设置,进入共享面板。
- 使用顶部的切换按钮**启用共享**。
- 然后,点击文件共享和**启用文件共享**。请确保启用网络。密码是可选的。如果你想为你的共享文件夹启用基于密码的认证,请启用它。
![在设置中启用共享][5]
![启用文件共享][6]
- 关闭设置窗口。
- 打开 GNOME Boxes。右键单击虚拟机并选择**偏好**。
- 在偏好设置窗口中点击**设备和共享**,并点击共享文件夹下的** [+] 按钮**。
- 在**本地文件夹下**:从你的宿主机中选择你想在客户机中访问的文件夹。
- **名称**:给予你想要的任何名称。这个名称将在客人的文件管理器中可见。
- 点击保存。
![在宿主机中添加一个共享文件夹][7]
#### 2. 为客户机设置
- 启动你的客户机虚拟机。
- 在客户机虚拟机内,打开文件管理器。如果你使用的是 GNOME 桌面,打开 Nautilus即 Files
- 点击**其他位置**。你应该在“网络”下看到 “**Spice 客户端文件夹**”。
- 双击这个,你应该看到你的主机系统的文件夹内容。
- 有时,上述文件夹需要一些时间才能出现。如果它不可见,请等待 1 或 2 分钟。通过 `F5` 刷新文件管理器窗口。
![客户机中的 Spice 客户文件夹][8]
#### 3. 一些故障排除
- 此外,如果你看到以下错误,那么你需要手动访问该路径。
```
Unable to access location - HTTP Error: Could not connect: Connection refused
```
![访问 spice 客户端文件夹时出错][9]
- 在文件管理器中按下 `CTRL+L`,调出地址栏。在地址栏中,输入以下内容:
```
dav://localhost:9843
```
- 然后点击回车。然后你应该看到文件夹的内容。SPICE 服务器使用 `dav` 协议,它在 9843 端口连接客户机和宿主机。
![通过 dav 协议访问][10]
就这样了。现在你可以在 GNOME Boxes 中享受客户机和宿主机之间的文件共享。
下面是一个客户机和宿主机访问同一个文件夹的截图。
![在 GNOME Boxes 中在客户机和宿主机之间共享文件夹及其内容(示例)][11]
如果你遇到任何错误,请在下方发表评论。
[_这篇文章中使用了一些来自 GitLab 的参考资料。_][12]
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/share-folder-gnome-boxes/
作者:[Arindam][a]
选题:[lkxed][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.debugpoint.com/author/admin1/
[b]: https://github.com/lkxed
[1]: https://www.debugpoint.com/tag/boxes
[2]: https://www.debugpoint.com/share-folder-virt-manager/
[3]: https://www.debugpoint.com/share-folder-between-host-guest-virtualbox/
[4]: https://www.spice-space.org/index.html
[5]: https://www.debugpoint.com/wp-content/uploads/2023/01/Enable-sharing-in-settings.jpg
[6]: https://www.debugpoint.com/wp-content/uploads/2023/01/Enable-File-Sharing.jpg
[7]: https://www.debugpoint.com/wp-content/uploads/2023/01/Add-a-share-folder-in-host.jpg
[8]: https://www.debugpoint.com/wp-content/uploads/2023/01/Spice-client-folder-in-guest.jpg
[9]: https://www.debugpoint.com/wp-content/uploads/2023/01/error-while-accessing-the-spice-client-folder.jpg
[10]: https://www.debugpoint.com/wp-content/uploads/2023/01/accessing-via-dav-protocol.jpg
[11]: https://www.debugpoint.com/wp-content/uploads/2023/01/Share-folder-and-its-contents-between-guest-and-host-in-GNOME-Boxes-sample.jpg
[12]: https://gitlab.gnome.org/GNOME/gnome-boxes/-/issues/430