使用环境(蓝色粗体字为特别注意内容)
1、软件环境:宿主机Windows 10企业版64bit,虚拟机VirtualBox5.2.16 r123759 (Qt5.6.2) 64bit
2、参考文献:https://www.crifan.com/summary_virtualbox_how_to_drap_and_drop_file_between_host_and_guest_vm/
相比于臃肿的VMware虚拟机,VirtualBox则要显得轻巧很多。最近在win10上面安装了VirtualBox5.2.16 r123759 64位版本。为了方便交互,安装了“增强功能”。
然后选择“拖放”-》“双向”,不出意外应该可以在虚拟机和实体机之间互相拖动文件。但是在我的机子中只能从实体机拖动到虚拟机,而无法从虚拟机拖动到实体机,报错如下:
Drag and drop error from guest (VERR_FILE_NOT_FOUND).
返回 代码: | VBOX_E_IPRT_ERROR (0x80BB0005) |
组件: | GuestWrap |
界面: | IGuest {13a11514-402e-022e-6180-c3944de3f9c8} |
很是无语,按照参考文献的提示,看了一下VirtualBox的ChangeLog发现如下的信息:
VirtualBox 5.2.20 (released October 16 2018)
This is a maintenance release. The following items were fixed and/or added:
- VMM: fixed task switches triggered by INTn instruction (bug #17979)
- Storage: fixed connecting to certain iSCSI targets (bug #17507)
- Storage: fixed handling of flush requests when configured to be ignored when the host I/O cache is used (bug #17573)
- Drag and drop: implemented support for UNC paths (bug #17146)
- Drag and drop: fixed resuming operation when restoring from a saved state (bug #17649)
- Drag and drop: fixed copying files with long file names (> 248 characters) from guests to Windows hosts (bug #17447)
- Drag and drop: fixed handling files with Unicode names on Windows guests (bug #15501)
- Drag and drop: fixed copying empty (0-byte) files to / from guests (bugs #14863 + #17443)
- Drag and drop: fixed copying over files from hosts to Linux guests (bug #16025)
- Networking: restore connectivity for guests bridged to host adapters that were unavailable temporarily (Windows hosts, bug #17090)
- Guest Control: fixed hang when using --wait-stdout and/or --wait-stderr (bug #17386). Needs updating Guest Additions
- Video recording: fixed starting video recording on VM power up (bug #17307)
- Linux Additions: various build fixes for kernel modules on recent distributions, and made sure modules end up in initramfs files
- Linux Additions: build fixes for 4.19, thank you Larry Finger
- Linux Additions: various small fixes for video driver
提到有关“Drag and drop”的相关改动都是“hosts to guests”,可能“ guests to hosts”就是一个有待改进的bug吧,我也没去细看changelog。既然是个bug,那如何才能方便的从虚拟机和实体机之间进行文件交换呢?答案是“共享文件夹功能”。通过VirtualBox的共享文件夹功能就能够方便的进行文件交换。但是有时候启用了共享文件夹功能之后往往无法在虚拟机系统里面看到共享文件夹,如果在xp系统里面出现这种情况:
1、首先确定VirtualBox共享文件夹功能是否正常开启,增强功能是否安装。
2、然后点击“网上邻居”-》“添加一个网上邻居”一步一步最后搜索到共享文件夹按提示操作即可。
如果是win7则可以在资源管理器中选择“映射网络驱动器”来映射VirtualBox共享文件夹。