• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1621
  • Last Modified:

How to mount a windows shared folder (host OS) from Linux (guest OS) in VMWare

I am trying to mount shared folder from Windows on Linux. I am using VMWare to run RedHat 9 as guest. I am trying to mount a windows shared folder from Linux. Here is the command I am using.

mount -t smbfs -o username="xxx/yyy",passwd=zzz //$ /mnt/local

The command barfs. Any pointers as to where I could be going wrong?

Kind regards
1 Solution
You'll have to 'escape' the '$' sign, i.e. use quotes or a backslash, e.g. :
mount -t smbfs -o username="xxx/yyy",passwd=zzz "//$" /mnt/local

There is a better way. Take a look at SMBmount :

[root@la-irvine3-ext admin]# which smbmount

I don't have the man page, but it is a lot easier to use.

Can you post the error *barf* ?


~K Black
Irvine, Ca.
smbmount //{NetBIOS name}/{share name} /mnt/local -o username=xxx/yyy passwd=zzz

This should work for you.  Note, I do not know if the system would like a / in the username field, so I hope that is just an indicator to show different passwords.  Remember, you have to use the NetBIOS name and not the IP address of the machine.

If you want to "browse" a machine to see what it has, just use:

smbclient -L {NetBIOS name}

When you get the password prompt, just hitting enter will show you the normal list, except for password protected shares.  If you enter the correct password, it will show you the normal list, with the password protected shares that use that password.


Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

sambleAuthor Commented:
I figured it out.

The syntax is:

mount -t smbfs -o username=yyy,workgroup=xxx //{NETBios name}/{share name} /mnt/local

Then you will be prompted for the password (You can also specify the password on the command line itself). You have to specify the "workgroup" option.

Thanks for trying to help me out guys.

Kind regards
Warning!!! What you are doing is NOT advised! If the remote system hangs it WILL hang BOTH. Please check out smbmount which is MUCH safer than mount in this case.
If the remote computer hangs while using smbmount, you simply log in as root, and give

smbumount /mnt/local

because issuing it as user causes problems.  If you use mount directly, you are either running as root, or mount is running as SU root, which makes it a root-level command, and no one can kill it if the remote machine either hangs or is rebooted.

Thanks ITG-SSNA for pointing that out.

PAQed with points (125) refunded

Community Support Moderator
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now