VMware虚拟机不显示主机共享文件夹?一条命令解决

以ubuntu为例哈:

vmware虚拟机共享文件夹不显示 虚拟机无法显示共享文件夹vmware虚拟机共享文件夹不显示 虚拟机无法显示共享文件夹


vmware虚拟机共享文件夹不显示 虚拟机无法显示共享文件夹


vmware虚拟机共享文件夹不显示 虚拟机无法显示共享文件夹


如果没有共享目录,不要着急,请运行下面命令来解决。

按照默认的Yes or No来选择相关的配置,在完成好所以配置命令后,请重新启动Ubuntu系统,现在应该解决了吧。

VMware 中的 Ubuntu 虚拟机看不到共享文件夹怎么办

我建议安装samba文件共享软件

安装 SAMBA 组件

sudo apt-get install samba bfs bclient

ubuntu 14.04 使用以下方式安装:

若之前有安装过相关软件包,先卸载之:

sudo apt-get autoremove samba samba-common

sudo apt-get autoremove -config-samba

按如下方式安装软件包

vmware虚拟机共享文件夹不显示 虚拟机无法显示共享文件夹


sudo apt-get install samba samba-common

sudo apt-get install -config-samba cifs-utils

配置相关参数

sudo gedit /etc/samba/b.conf

文件中相关属性如下

1.全局设置部分

security = user

这行设置了samba的安全等级,Samba一共可以设置四个安全登记,由底到高分别为:

share 这个选项表示任何人都可以不需要输入密码登录。

user 这个是Samba的默认级别,要求每个用户必须输入密码才能登录。

server use别的密码都是保存在本机上,而serve别的密码和用户名都保存在另一台主机上。

domain 这个级别要求网络里必须有一台Windows的域,验证工作由域来完成。

需要注意,只要输入用户名和密码的级别,其用户名一定首先也是Linux系统内的用户

workgroup = MSHOME

这部分是Windows主机的工作组明,Windows主机必须在同一个工作组中

server string = %h server(Samba,Ubuntu)

这个选项是显示在Windows上的信息,可以自定义,其中%h为Samba配置文件中的变量,代表了主机名,即使用hostname命令得到的主机名

map to guest = bad user

当 security = user 时,这个选项必须注释掉,如:# map to guest = bad user

2.共享设置部分

添加一个共享文件夹设置如下

[share]

共享文件名,不需要与实际文件名一致

comment = my share directory

对这个共享分支的描述

path = /home/share

系统的共享目录,必须为路径

public = yes

是否允许所有人都能够看到此目录,no为看不到

writable = yes

是否允许用户在此目录下可写,no为不可些,如果可写,还需要目录具有写权限

read only = yes

设置用户是否只读

vaild users = username

设置只有 username 用户有效

SAMBA 用户管理

在需要密码登录时有效,在设置用户密码时,此用户必须是LINUX系统的用户,如下面的指令 user 必须先是系统的用户

sudo bpasswd -a user

接下来根据提示输入两次密码即可

bpasswd 指令相关参数如下:

-a 新添加一个Samba用户。

-d 禁用一个Samba用户。

-e 使禁用的Samba用户解禁。

启动 SAMBA 服务

# 停止 SAMBA 服务

sudo /etc/init.d/bd stop

# 启动 SAMBA 服务

sudo /etc/init.d/bd start

# 重新启动

sudo /etc/init.d/bd restart

在 WINDOWS 下访问共享目录

# 在资源管理器,或浏览器中直接输入即可, “192.168.1.10” 为 IP

192.168.1.10

故障测试指令

testparm

为什么我在vmware设置的主机共享文件夹在虚拟机中看不到?

虚拟机与主机之间共享文件,须在虚拟机设置里先设置好,然后在虚拟机里访问共享文件。图示如下,供你参考:

1、在虚拟机设置里添加共享文件夹:

2、在虚拟机中访问共享文件夹。

win7虚拟机vm共享文件夹看不到

在虚拟机主页,选择Win7虚拟机的“编辑虚拟机设置”,进入设置。

在“虚拟机设置”的“选项”选项卡下找到“共享文件夹”,在右侧点击“总是启用”,在下方点击“添加”进行共享文件夹的添加。

在弹出的对话框下,浏览选择文件夹作为共享文件夹。共享文件夹的名称会自动填充,当然也可以自定义。

点击“下一步”,进入文件夹属性指定的对话框,“启用共享”必选。如果不希望虚拟机对文件进行更改,也可以勾选“只读”。

返回“虚拟机设置”对话框,选中自己的共享文件夹,勾选“在Windows客户机中映射为网络驱动器”。

进入虚拟机,打开“计算机”就可以看到在“网络位置”的共享文件夹了。

VM虚拟机 找不到共享文件夹

故更新vmware-tools,点击update vmware-tools,删除掉/tmp目录下前个版本的vmware-tools-distrib以及安装包,将更新安装包到/tmp目录下。

[root@simba-PC ~]# mount /dev/cdrom /mnt/cdrom

mount: mount point /mnt/cdrom does not exist

[root@simba-PC ~]# cd /tmp

[root@simba-PC tmp]# ls

bashrc virtual-root.KkjqhX

bashrc_hlink virtual-root.LHoock

bashrc_slink virtual-root.LqnTi4

bashrc_slink_2 virtual-root.lQtE6R

emacs7RR680 virtual-root.Lx8UCY

etc virtual-root.LZDDK2

keyring-IdMO5s virtual-root.NmKmtQ

keyring-KR3jPA virtual-root.oEJ6EY

keyring-LTujbu virtual-root.PE7rAj

keyring-o04jCc virtual-root.pPwnlD

keyring-oyoOxh virtual-root.qaVq5s

keyring-psThJa virtual-root.QwmNmy

keyring-QZCwGM virtual-root.r2bAXH

vmware虚拟机共享文件夹不显示 虚拟机无法显示共享文件夹


keyring-rPSusd virtual-root.Rgz9KF

keyring-U7tGGn virtual-root.rhMsvf

keyring-UcQZ3a virtual-root.sMp7VD

keyring-UDWQd3 virtual-root.ujjBTI

man.config virtual-root.VCwMfz

mvtest2 virtual-root.vEov6R

orbit-gdm virtual-root.VnMxas

orbit-root virtual-root.WHPz5P

pulse-5bjypejDF8kQ virtual-root.xMpjI8

pulse-7TpHe7zldIwM virtual-root.xsxXQh

pulse-BL42PuWp8e8q virtual-root.XUm6X4

pulse-mzQrmZsPx3XV virtual-root.Yf8rql

tmp9MHNPP virtual-root.Z2Ceyg

tmpzk9bR7 virtual-root.zMzDYN

virtual-oracle.bn1mA7 virtual-root.ZWOk8d

virtual-root.1QXlik virtual-simba.36c6Jl

virtual-root.5CHiOt virtual-simba.bzhi3D

virtual-root.6L18AC virtual-simba.gxa4iy

virtual-root.B3ewf9 virtual-simba.wa2lwj

virtual-root.BABJU7 vmware-config0

virtual-root.CO2hrg vmware-config1

virtual-root.cScHZC vmware-config2

virtual-root.Czvlke vmware-config3

virtual-root.eHTiDs VMwareDnD

virtual-root.gd2MUn vmware-root

virtual-root.GsXYFI VMwareTools-8.8.1-528969.tar.gz

virtual-root.hsntrp yum.log

virtual-root.IDGGfX yum_se_tx-2012-02-10-23-04hl1rlH.yumtx

virtual-root.kistah

[root@simba-PC tmp]# tar zxpf VmwareTools-8.8.1-528969.tar.gz

tar (child): VmwareTools-8.8.1-528969.tar.gz:无法 open: 没有那个文件或目录

tar (child): Error is not recoverable: exiting now

tar: Child returned status 2

tar: Error is not recoverable: exiting now

[root@simba-PC tmp]# tar zxpf VMwareTools-8.8.1-528969.tar.gz

[root@simba-PC tmp]# ls

bashrc virtual-root.KkjqhX

bashrc_hlink virtual-root.LHoock

bashrc_slink virtual-root.LqnTi4

bashrc_slink_2 virtual-root.lQtE6R

emacs7RR680 virtual-root.Lx8UCY

etc virtual-root.LZDDK2

keyring-IdMO5s virtual-root.NmKmtQ

keyring-KR3jPA virtual-root.oEJ6EY

keyring-LTujbu virtual-root.PE7rAj

keyring-o04jCc virtual-root.pPwnlD

keyring-oyoOxh virtual-root.qaVq5s

keyring-psThJa virtual-root.QwmNmy

keyring-QZCwGM virtual-root.r2bAXH

keyring-rPSusd virtual-root.Rgz9KF

keyring-U7tGGn virtual-root.rhMsvf

keyring-UcQZ3a virtual-root.sMp7VD

keyring-UDWQd3 virtual-root.ujjBTI

man.config virtual-root.VCwMfz

mvtest2 virtual-root.vEov6R

orbit-gdm virtual-root.VnMxas

orbit-root virtual-root.WHPz5P

pulse-5bjypejDF8kQ virtual-root.xMpjI8

pulse-7TpHe7zldIwM virtual-root.xsxXQh

pulse-BL42PuWp8e8q virtual-root.XUm6X4

pulse-mzQrmZsPx3XV virtual-root.Yf8rql

tmp9MHNPP virtual-root.Z2Ceyg

vmware虚拟机共享文件夹不显示 虚拟机无法显示共享文件夹


tmpzk9bR7 virtual-root.zMzDYN

virtual-oracle.bn1mA7 virtual-root.ZWOk8d

virtual-root.1QXlik virtual-simba.36c6Jl

virtual-root.5CHiOt virtual-simba.bzhi3D

virtual-root.6L18AC virtual-simba.gxa4iy

virtual-root.B3ewf9 virtual-simba.wa2lwj

virtual-root.BABJU7 vmware-config0

virtual-root.CO2hrg vmware-config1

virtual-root.cScHZC vmware-config2

virtual-root.Czvlke vmware-config3

virtual-root.eHTiDs VMwareDnD

virtual-root.gd2MUn vmware-root

virtual-root.GsXYFI VMwareTools-8.8.1-528969.tar.gz

virtual-root.hsntrp vmware-tools-distrib

virtual-root.IDGGfX yum.log

virtual-root.kistah yum_se_tx-2012-02-10-23-04hl1rlH.yumtx

[root@simba-PC tmp]# cd vmware-tools-distrib

[root@simba-PC vmware-tools-distrib]# ls

bin doc etc FILES INSTALL installer lib vmware-install.pl

[root@simba-PC vmware-tools-distrib]# ./vmware-install.pl

A previous installation of VMware Tools has been detected.

The previous installation was made by the tar installer (version 4).

Keeping the tar4 installer database format.

You he a version of VMware Tools installed. Continuing this install will

first uninstall the currently installed version. Do you wish to continue?

(yes/no) [yes] yes

Uninstalling the tar installation of VMware Tools.

Stopping VMware Tools servs in the virtual machine:

Guest operating daemon: [确定]

The removal of VMware Tools 6.0.2 build-59824 for Linux completed successfully.

Thank you for hing tried this software.

Installing VMware Tools.

In which directory do you want to install the binary files?

[/usr/bin]

What is the directory that contains the init directories (rc0.d/ to rc6.d/)?

[/etc/rc.d]

What is the directory that contains the init scripts?

[/etc/rc.d/init.d]

In which directory do you want to install the daemon files?

[/usr/in]

In which directory do you want to install the library files?

[/usr/lib/vmware-tools]

The path "/usr/lib/vmware-tools" does not exist currently. This program is

going to create it, including needed parent directories. Is this what you want?

[yes] yes

In which directory do you want to install the documentation files?

[/usr/share/doc/vmware-tools]

The path "/usr/share/doc/vmware-tools" does not exist currently. This program

is going to create it, including needed parent directories. Is this what you

want? [yes] yes

The installation of VMware Tools 8.8.1 build-528969 for Linux completed

successfully. You can decide to remove this software from your at any

time by invoking the following command: "/usr/bin/vmware-uninstall-tools.pl".

Before running VMware Tools for the first time, you need to configure it by

invoking the following command: "/usr/bin/vmware-config-tools.pl". Do you want

this program to invoke the command for you now? [yes] yes

Initializing...

Making sure servs for VMware Tools are stopped.

[EXPERIMENTAL] The VMware FileSystem Sync Driver (vmsync) is a new feature that

creates backups of virtual machines. Please refer to the VMware Knowledge Base

for more details on this capability. Do you wish to enable this feature?

[no] no

Found a compatible pre-built module for vmci. Installing it...

Found a compatible pre-built module for vsock. Installing it...

The module vmxnet3 has already been installed on this by another

installer or package and will not be modified by this installer. Use the flag

--clobber-kernel-modules=vmxnet3 to override.

The module pvscsi has already been installed on this by another

installer or package and will not be modified by this installer. Use the flag

--clobber-kernel-modules=pvscsi to override.

The module vmmemctl has already been installed on this by another

installer or package and will not be modified by this installer. Use the flag

--clobber-kernel-modules=vmmemctl to override.

The VMware Host-Guest File allows for shared folders between the host OS

and the guest OS in a Fusion or Workstation virtual environment. Do you wish

to enable this feature? [yes] yes

Found a compatible pre-built module for vmhgfs. Installing it...

Found a compatible pre-built module for vmxnet. Installing it...

!!! [EXPERIMENTAL] !!!

VMware automatic kernel modules enables automatic building and installation of

VMware kernel modules at boot they are not already present. By selecting yes,

you will be enabling this experimental feature. You can always disable this

feature by re-running vmware-config-tools.pl.

Would you like to enable VMware automatic kernel modules?

[no] no

Disabling timer-based audio scheng in pulseaudio.

Detected X server version 1.10.4

Distribution provided drivers for Xorg X server are used.

Skipping X configuration because X drivers are not included.

Creating a new initrd boot image for the kernel.

vmware-tools start/running

The configuration of VMware Tools 8.8.1 build-528969 for Linux for this running

kernel completed successfully.

You must restart your X session before any mouse or graphics changes take

effect.

You can now run VMware Tools by invoking "/usr/bin/vmware-toolbox-cmd" from the

command line or by invoking "/usr/bin/vmware-toolbox" from the command line

during an X server session.

To enable aanced X features (e.g., guest resolution fit, drag and drop, and

file and text copy/paste), you will need to do one (or more) of the following:

1. Manually start /usr/bin/vmware-user

2. Log out and log back into your desktop session; and,

3. Restart your X session.

To use the vmxnet driver, restart networking using the following commands:

/etc/init.d/network stop

rmmod pcnet32

rmmod vmxnet

modprobe vmxnet

/etc/init.d/network start

Enjoy,

--the VMware team

Found VMware Tools CDROM mounted at /media/VMware Tools. Ejecting dev

/dev/sr0 ...

[root@simba-PC vmware-tools-distrib]# cd /mnt

[root@simba-PC mnt]# cd hgfs/share/

#事先已经设置了share文件夹为共享文件夹

[root@simba-PC share]#

vmware中按要求设好共享文件 但在虚拟机中却始终不显示 不明白 友人帮帮忙

真没见过你这样的情况,以我的理解可能是你安装的VM软件是精简版或者绿色版,系统缺少必要的服务。

至于主机与虚拟机共享文件,有很多种方法:

1、安装VM TOOL,就可以直接从主机和虚拟机之间拖拽或者文件了。

2、可以把虚拟机的某个磁盘分区加载到主机中,从而达到文件的共享和交换。

3、可以把主机的整个磁盘或者某个分区加载到虚拟机中,从而达到文件的共享和交换。

4、使用diskgenius打开虚拟机的虚拟磁盘,可以像虚拟机的磁盘中添加文件或者拷贝出来文件。

5、使用局域网共享功能实现主机与虚拟机之间的文件传递。

6、借助外部设备,比如U盘实现主机与虚拟机之间的文件传递。

可以参考我的空间文章。

VMware虚拟机共享文件夹为空问题解决办法

1、安装kernel相关组件(以centos7为例): yum install kernel kernel-headerskernel-dl-y

2、编写挂载文件,命名为:xxxx.sh,存放位置无要求,文件内容为:

#!/bin/bash

vmware-hgfsclient | while read folder; do

echo "[i] Mounting ${folder} (/mnt/hgfs/${folder})"

mkdir -p "/mnt/hgfs/${folder}"

umount -f "/mnt/hgfs/${folder}" 2>/dev/null

vmhgfs-fuse -o allow_other -o auto_unmount ".host:/${folder}" "/mnt/hgfs/${folder}"

done

sleep 2s

参考:

3、按照上述方法,重启终端后,共享文件夹又为空。所以需要每次启动终端后再次执行,设置每次启动终端后自动执行的方法:

修改开机启动文件 :/etc/rc.local;

再最末位加上文件就可以,需要加上路径,如 :/home/xxx/xxx.sh