虚拟机: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:https://baike.baidu.com/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_other
	      This  option  overrides  the  security measure restricting file access to the user mounting the filesystem.  So all users (including
	      root) can access the files.  This option is by default only allowed to root, but this restriction can be removed with  a	configura-
	      tion option described in the previous section.

参考链接

(1)Unix and Linux Forums
https://www.unix.com/man-page/centos/8/mount.fuse/

  • 14
    点赞
  • 68
    收藏
    觉得还不错? 一键收藏
  • 4
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值