失眠网,内容丰富有趣,生活中的好帮手!
失眠网 > 虚拟机:centos在主机和虚拟机之间传输文件

虚拟机:centos在主机和虚拟机之间传输文件

时间:2024-03-30 20:52:52

相关推荐

虚拟机:centos在主机和虚拟机之间传输文件

虚拟机:centos在主机和虚拟机之间传输文件

问题原因:

想在虚拟机上跑一下安装oracle的流程,但是官网已经没有11g版本的压缩包了,遂从网盘上找资源,把安装包下载到了本机上。想把压缩文件从主机上直接复制到虚拟机上,却报了如下错误:

复制时错误:No such file or directory

网上找到的教程说是vmware Tools又问题,遂卸载重装,中间亦走了不少弯路。

终于vmware Tools安装好了,复制时又报了复制时错误(果然精进能力的旅途中要做很多无用功)

后来放弃了,采用共享文件夹形式来做文件传输。记录学习与配置过程如下:

1.虚拟机 -> 设置->选择共享文件夹总是启用

2.配置主机路径

要进行传输的文件都将放在该目录下

3.配置虚拟机路径

进入centos

(1)进入mnt路径

(2)创建共享文件夹share_files

(3)挂载

(4)永久挂载设置

vim /etc/fstab

添加如下内容:

至此,教程结束,已可成功在centos虚拟机和主机之间进行文件共享。

补充说明:

命令mount -t fuse.vmhgfs-fuse .host:/ /mnt/share/ -o allow_other详解

(1)查看挂载命令的指令详情

options: -t--types <list> limit the set of filesystem types限制文件系统类型集--source <src> explicitly specifies source (path, label, uuid)显式指定源(路径、标签、uuid)uuid:/item/UUID/5921266?fr=aladdin--target <target> explicitly specifies mountpoint显式指定挂载点

(2)fuse

fuse - format and options for the fuse file systems

(3)allow_other

allow_otherThis option overrides the security measure restricting file access to the user mounting the filesystem. So all users (includingroot) can access the files. This option is by default only allowed to root, but this restriction can be removed with aconfigura-tion option described in the previous section.

参考链接

(1)Unix and Linux Forums

/man-page/centos/8/mount.fuse/

如果觉得《虚拟机:centos在主机和虚拟机之间传输文件》对你有帮助,请点赞、收藏,并留下你的观点哦!

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。