Ubuntu: Creating a symlink with network shared folder

I'm trying to create a symlink with a network shared folder (located in a Windows system) from my Ubuntu system using the command.

ln -s smb://sys-name/www www

It creates a link but it says the link is broken. But the path exists and I can browse to the network folder path.

Could anybody point me the issue?

Basically, I'm trying to create the link as I'm not able to access the network shared files from Eclipse, so thought of making use of the symlinks, but didn't work out. Any other workaround for this?


You can't make a link to something which isn't in your filesystem. That you can browse it is a feature of your file browser; that's why it doesn't work with eclipse or ln.

What you want to do is mount the remote filesystem into your filesystem. For example mount -t cifs //sys-name/www www. See man mount.cifs for more details.


As others pointed out, mount the folder instead. I'd suggest to create a mount point under /mnt, like /mnt/www (historically, /mnt is used for the non-removable mount points, /media is recommended for removable media only). Then, mount the network share, e.g.:

mount -t cifs //server/share /mnt/www --verbose -o user=username

If you don't want to type this every time you login, you could add an entry to /etc/fstab. If you want to learn more about /etc/fstab, see How to edit and understand /etc/fstab.