9

I develop web-apps using ubuntu (jaunty) but have a need to work on a site that must be hosted on windows. I've setup virtualbox with a winxp32 installation and shared the entire hard disk. My goal is to be able to use eclipse(pdt) in ubuntu to create a new php project that references my wwwroot folder of the winxp installation.

I've got everything setup so I can browse the VM via smb://192.168.../www/ with no problem. However, I'm stumped when it comes to setting up the project in eclipse since it's outside of the normal workspace. I tried tinkering with creating a symbolic link in the workspace to my share but I'm not sure how to do that.

I've tried to create a symlink to the share but ubuntu says it's broken

ln -s smb://192.../www/ windows

I've read that I need to mount the shared drive first then symlink that but don't have any experience with that.

2 Answers 2

10

You can't symlink a network share like that. Symlinks only work between files/directories on the same computer (and hardlinks are even more restrictive - they need to be on the same filesystem/partition).

First make sure the smbfs package is installed on Linux:

sudo apt-get install smbfs

Or in >14.04:

sudo apt-get install cifs-utils

Now create a share on the Windows machine. Call it "www" or something.

Now make a directory on Linux, let's say it's called "windows".

Now mount the Windows share on Linux:

sudo mount -t smbfs 192.168.x.x/www windows

Or try "cifs" instead of "smbfs" if something is not right.

At this point, everything you see in the "windows" directory is the stuff actually on the "www" share on Windows. You can symlink the "windows" directory if you wish (but you could create it directly in the place you want it so no symlink is required):

ln -s windows /some/arbitrary/destination

Finally, read this:

# MountWindowsSharesPermanently

3
  • 3
    Thanks Florin. I had to tweak the mount command and add // in front of the IP, after that it worked like a charm. Much thanks.
    – Mike B
    Commented Oct 29, 2009 at 17:57
  • i think you actually want mount -t cifs if it's available. smbfs is a good fallback but i think cifs is generally the preferred of the two. Commented Nov 2, 2009 at 3:33
  • You may have to run mount.cifs instead of mount -t cifs.
    – indiv
    Commented Feb 8, 2014 at 1:41
3

One quick solution is to access the share with nautilus (going to Network or manually entering smb://...). After the share is accessed recent versions of ubuntu automatically mount the file share in the directory ~/.gvfs. This is a regular file system directory that can be soft-linked using ln -s.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .