How to Map Windows Share in Ubuntu

Ubuntu has become one of the most popular Linux distributions out there. This is a part of mini-series on how to leverage Ubuntu to share files between Windows and Ubuntu. In this guide we will look at different ways to mount Windows shares in Ubuntu. We will use a general command line method, as well as an alternative GUI method through virtual machine to auto mount host machine shares. For the purpose of illustration, we will use VirtualBox as the virtual machine application, it’s free and available for all major platforms.

Option One: Map Windows Host Machine Share folder in Ubuntu

If you are running Ubuntu inside a virtual machine (chances are most people run linux inside a VM) there are existing tools you can leverage to help you mount shares between host machine and the virtual machine. If all you want is to able to access files both ways this is how you can do it. In VirtualBox, before you boot up the server. Go to Devices > Shared Folders Settings Mount Windows share Click a plus folder icon under the “Shared Folders” settings. Mount Windows share Select the folder you’d like to share with Ubuntu, and check “Auto-mount” and “Make Permanent”. Mount Windows share Now when you login into Ubuntu, launch Terminal and type mount you will see a list of network shares mounted to the system. The “Download” directory that we previous added through VirtualBox share folders option is listed under /media/sf_Downloads  Mount Windows share

Option Two: Mount A Windows Network SMB Share Through Command Line

If you also want to map Windows smb network shares inside Ubuntu, you can also do the following on the command line. First install mount.cifs utility command if you don’t have it installed. Then create a directory under /mnt mount directory. sudo apt-get install cifs-utils sudo mkdir /mnt/sharename sudo mount.cifs //hostname/sharename ~/mnt/sharename -o user=username pass=password If the smb network share doesn’t support guest access, then you need to pass the active directory or account username and password as the additional options. Replace “hostname” and “sharename” to the appropriate network on your system. This is it, two options to help you get started using Ubuntu while have complete access to files from Windows environments.

Jonathan Hu

Programming by day, Web Development, Canucks & Movies for spare time!
Co-founder of Next of Windows and a cool geek 🙂

Last updated: 08/04/2014

Posted in: How to , IT Pro
Discover more: , , ,

Leave a Reply

Notify of
avatar
wpDiscuz
Today's Top Picks for Our Readers:
Recommended by Recommended by NetLine