header image
Home arrow LUG How Tos arrow How To Mount Win Drive To Linux VM
How To Mount Win Drive To Linux VM Print
Jun 18, 2007 at 12:00 AM

# Note: ~ = home directory (/home/john)

# Install smbfs:
  sudo apt-get install smbfs

# Enable users to mount and umount the shares to their respective drives.
  chmod u+s /usr/bin/smbmnt
  chmod u+s /usr/bin/smbumount


# Create directory where you will mount windows drive:
  mkdir ~/windowsC

# mount share
# This will mount the windows share("hostname\C$") to ("~/windowsC"). If you leave password out you will be prompted for the password.
# fmask and dmask were added to enable read/write permissions.
  smbmount \\\\hostname\\C$ ~/windowsC -o username=domain\\WindowsLoginName,fmask=644,dmask=744
# or
  smbmount \\\\hostname\\C$ ~/windowsC -o username=domain\\WinUser,password=********,fmask=644,dmask=744

# Unmount drive when done:
  smbumount ~/windowsC

# If you want to put MountC and UnmountC scripts into Nautilus File Browser right click menu:

# Create MountC and UnmountC Scripts

# MountC Script
  #!/bin/bash
   PASSWORD=`zenity --title "Login" --entry --text "Enter Password for windowsC" --hide-text`
   smbmount \\\\hostname\\C$ ~/windowsC -o username=domain\\WinUser,password=$PASSWORD,fmask=644,dmask=744
   exit 0


# UnmountC Script
   #!/bin/bash
   smbumount ~/windowsC
   exit 0


# Make scripts executable:
   chmod 755 MountC
   chmod 755 UnmountC


# Copy scripts into ~/.gnome2/nautilus-scripts directory
# Right click on desktop and select Scripts->MountC
# Enjoy

EC_LUG -Eau Claire Linux users group is an informal group of Linux and open source software enthusiasts.

We meet each Thursday at 7 p.m. at  420 Cafe, 420 Washington Ave. Eau Claire, Wisconsin.

Linux 101:
What's All The Fuss? video...

Mac vs. PC: How Would Linux Fit?
video1...

video2...
video3...

Linux User GroupsLug Link Logo