Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've been setting up a dev machine over the last week and I want to be able to network the drive on my host Windows Server machine, using hyper v, to my guest Ubuntu Server machine.

Server address is \\SRV

File share is \\SRV\public_html and is accessed on my guest Windows XP machine for shared verification.

Any links or suggestions would be awesome on how to do this from the terminal.


I used this to install samba and, I created the cedentials file manually using sudo touch credentials as suggested by answer below

share|improve this question
up vote 3 down vote accepted

Edit /etc/fstab, add an entry like:

# Samba
//server/share  /media/samba  cifs  credentials=/etc/samba/credentials,uid=1000,gid=100  0  0

Where: "Server" = Samba server (by IP or name if you have an entry for the server in your hosts file

"share" = name of the shared directory

In the credentials file put two lines


Make the file owned by root and ro by root (sudo chown root.root /etc/samba/credentials && sudo chmod 400 /etc/samba/credentials)

share|improve this answer
I do not have a samba dir do I need to apt-get something? – Kevin D. Nov 3 '10 at 17:54
I have only installed the core components. – Kevin D. Nov 3 '10 at 18:03
You need to install samba to access to windows shares from Linux. – João Pinto Nov 3 '10 at 18:13

About Hyper V I can't help you because never used it. The networking setup is Hyper-V specific, if possible you should set it up using NAT.

To access the shared drive from Ubuntu: From the top panel. Places -> Connect to Server -> Select Windows share and provide the required info.

share|improve this answer
Any idea how to do this from Ubuntu server terminal? – Kevin D. Nov 3 '10 at 17:19

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.