Windows and Ubuntu and Windows and......

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
ubudunce
Level 2
Level 2
Posts: 12
Joined: Sat Aug 27, 2011 2:41 am

Windows and Ubuntu and Windows and......

Post by ubudunce »

Hi folks
I am a complete noob to this Ubuntu stuff, so please forgive me if I ask a dumb Question, or ramble on....
I have been told that I am trying to run before I can crawl, but here goes.....

I have a few old Windows programs that are no longer supported or run correctly on Vista or Win7, but work happily in XP. These are used for my business and are mission critical. The two main ones are Labels Unlimited and Sage Line50 ver11. I am fed up with being told to keep buying new software because Windows no longer supports my software. LU2 is no longer available, So I have been persuaded to try Ubuntu.

So far so good.
Here's the snag - both programs access their data across the Windows Domain, and need to see a mapped drive (G: )!

I have installed Ubuntu and Wine(1.2)and Samba. I have (after a bit of faffing around) installed both software packages on the Ubuntu computer. They both seem to work fine with local data. I can see (and mount) the windows data share (server1/data), however I cannot seem to find out how to assign a drive letter to it. I realise that Linux doesn't use drive letters in the same way and have been told that Samba is the way to do it, but it seems that Samba is fine for sharing Linux folders, but not what I need.
Bearing in mind that I am a complete novice with Ubuntu (cant even find the Terminal window!!), have only been trying it (Ubuntu) for 4 days, and my programming skills stopped at 6502 assy language and paper tape Basic. Can anyone talk this dunce throw the operations, or is there a "Dummies Guide"? I have spent a day and a bit browsing the Interweb thingy and have found lots of stuff about accessing Windows shares, but nothing in particular showing how I can assign a drive letter to a Windows share, so that I can run Windows software under Ubuntu.
I realise that this may be an unusual way of running things, but surely I cant be the only one?

I have seen that others have used Sage Line50 on Linux, so I can only think that I must be having "finger" trouble in mapping a windows network share.
I have done a quick search, but to no avail. Can anyone assist?
doh123
Level 8
Level 8
Posts: 1227
Joined: Tue Jul 14, 2009 1:21 pm

Post by doh123 »

Windows uses drive letters... Linux does not.

You need to do what it says.. and mount shares onto your machine, which will mount to a folder. Once you have access to the network drive just fine in Linux... then you can config that link in Wine so its seen as a drive letter to the Windows program. Run winecfg ('wine winecfg' in Terminal), and you should find a tab there where you can set up drive letters and pick where you want them pointed to on your machine.
ubudunce
Level 2
Level 2
Posts: 12
Joined: Sat Aug 27, 2011 2:41 am

Post by ubudunce »

That is what has me confused. I can mount the Windows share - it comes up on the desktop, but I cant find it thru Wincfg to allocate a letter to it. I am sure it is finger trouble on my part, but that doesnt help me figure it out :(.
jorl17
Level 5
Level 5
Posts: 365
Joined: Mon Jul 28, 2008 6:44 pm

Post by jorl17 »

ubudunce wrote:That is what has me confused. I can mount the Windows share - it comes up on the desktop, but I cant find it thru Wincfg to allocate a letter to it. I am sure it is finger trouble on my part, but that doesnt help me figure it out :(.
A simple google search might answer that. Search for "where are samba shares mounted ubuntu". Here's my first query: http://fixunix.com/ubuntu/543595-where- ... hares.html

So, after reading it (you really should), they're probably at $HOME/.gvfs.

IIRC, when I used Ubuntu, that's where I used to find them.
ubudunce
Level 2
Level 2
Posts: 12
Joined: Sat Aug 27, 2011 2:41 am

Post by ubudunce »

Thanks for that. I did search but, as usual, its knowing the correct Q to ask, particularly in Google.

Unfortunately, I dont seem to have a home/.gvfs folder or a /mnt or a etc/fstab folder. Dont forget you are talking to a guy that has had a whole 4 days with Ubuntu, so i really do need my hand held here.

I can see the drive on "places" and if I click on it, it opens and places a folder on the desktop. Not sure if that helps you guys, but I am at a loss as to what to do. I am not even sure if it is a Samba share. I just browsed the network and went into "Server1", right clicked "Data" and clicked on "mount".
jorl17
Level 5
Level 5
Posts: 365
Joined: Mon Jul 28, 2008 6:44 pm

Post by jorl17 »

ubudunce wrote:Thanks for that. I did search but, as usual, its knowing the correct Q to ask, particularly in Google.

Unfortunately, I dont seem to have a home/.gvfs folder or a /mnt or a etc/fstab folder. Dont forget you are talking to a guy that has had a whole 4 days with Ubuntu, so i really do need my hand held here.

I can see the drive on "places" and if I click on it, it opens and places a folder on the desktop. Not sure if that helps you guys, but I am at a loss as to what to do. I am not even sure if it is a Samba share. I just browsed the network and went into "Server1", right clicked "Data" and clicked on "mount".
Alright, this is less related to Wine and more related to the overall Unix experience.

You *have* /etc/fstab. It is granted that you do. The thing is that it is not etc/fstab, but /etc/fstab. You see, in Windows you had C: and D:, but in here you have whatever you want. These "mount points" can be /my_drive or /etc/my_drive, or anything else, really! Usually, though, they're in /mnt and /media (remember that names are case-sensitive in Unix). One very important mountpoint is the root of the file system, where the tree branches from: it's "/". The "system root" is at /, so all absolute paths will necessarily start with /, which is where the tree starts: There's nothing before it. There are even ways to temporarily change your root, but that's a whole different subject. The important thing to remember is that if you're using an absolute path, you'll have to have it start with /.

As for "home", you shouldn't type "home" in there. In Linux, all users have a home folder. root, for instance, is many times found in /root. However, in Ubuntu, this defaults to a /home/$USER folder. What's $USER, you say? It's an environment variable that holds the username of the current logged in user. So in my Linux, if I type "echo $USER" in a console, it spits out "jorl17", which is my username. If, however, I am root and type that, I get "root".

Much like $USER, other variables are commonly used, such as $PWD (has the current directory), or $HOME, which points to the home folder that I have been talking to. In my case (because I set it up like that), it is /home/jorl17, but when I'm root, if I do "echo $HOME", I get /root. So it isn't sure that /home/$USER is the same as $HOME (which many naive scripters assume).

Out of curiosity, you can see what environment variables you have defined by opening up a terminal and typing "env" (without quotation marks). One of the most important ones is $PATH, which you should google right away ;).

If you clicked mount and it is in a Windows machine, it is almost certainly a samba share.

As you get used to Linux and Unix you should get familiar with the concepts of mounting, mount points, as well as some essential utilities that exist in the shell:
  • echo prints text and has many options
  • cat prints the contents of files. (ex: cat /etc/fstab)
  • grep is used to filter the output of text, as to find files.
  • find recursively lists the current directory and can be used with many options to effectively find files.
  • locate is another utility similar to find but that uses indexing (someone correct me if that's wrong) to make it work faster
  • which tells you where a program is in your $PATH
  • etc
Those were just a couple of utilities that I spit out to make you familiar with the things you'll see in many linux forums. With practice you'll master them, but don't expect people to tell you to click this and that, particularly because Linux is so fragmented and so many different interfaces exist.[1] The terminal/console is Universal and goes far beyond Linux, touching the beautiful and powerful superiority of the Unix way of doing things.

[1] Fragmentation is everywhere in the world of Linux. For instance, there are truly no universal graphical interfaces or even toolkits. Some people use Gnome, others KDE, others XFCE, etc. Then the different toolkits arrive, such as GTK, Qt, FLTK. While this is very positive for the control of the system (it is highly configurable; I, for instance, have no Gnome or KDE: I run openbox with fbpanel, my own programmed utilities, pcmanfm and some other things I added), it is not healthy for the community as a whole. You also see fragmentation in the sound infrastructures, with the classical ALSA vs OSS and ALSA w/o Pulseaudio vs ALSA w/ Pulseaudio, etc. Get used to this kind of fragmentation: it gives you tremendous power, but it also tears apart a community made of so many intelligent people.

Cheers,

Jorl17
Martin Gregorie

Windows and Ubuntu and Windows and......

Post by Martin Gregorie »

On Sat, 2011-08-27 at 14:32 -0500, jorl17 wrote:
locate is another utility similar to find but that uses indexing
(someone correct me if that's wrong) to make it work faster
'locate' is fast because it searches a database of all the filenames in
the system. The database is rebuilt on a daily basis when the cron
daemon runs 'updatedb' via the mlocate.cron script [1], so it can can be
up to 24 hours out of date. The command 'locate text' will list all the
files or directories that have 'text' anywhere in their absolute
pathname, i.e. if you wanted to find a file called recipes_etc and
entered the command 'locate etc', locate would list it if it existed
when updatedb was last run but would also list the several hundred files
in the /etc directory structure. 'locate' is very fast because all the
text it searches is gathered into one place but you have to be aware
that its never fully up to date, that it is matching on absolute path
names and that it always looks at every filename anywhere in your
system.

'find', on the other hand, is a lot slower because it has to read
through all the directories its been asked to search but is always
up-to-date because it is looking directly at the filing system. It has
fewer gotchas because of this. It can also search just a selected part
of the filing system. e.g. if you are on your $HOME directory, running

find . -name '*etc*'

will only search the current directory ('.') and all the directories
within it. Specifying the search text as '*etc*' is necessary to find
files containing 'etc'. If you just asked for 'find . -name etc' it
would only find files and directories whose name is 'etc' and only
'etc'. If you put globs (* matches zero or more characters) or question
marks (? matches a single character in that position) in the search
pattern you should enclose them in single quotes to prevent the shell
from expanding them.

Find is extremely versatile: it understands and can use file creation
time or last access time as search terms and can also run commands
against matching files:

find . -name '*.bak' -exec rm {} \;

will delete all files with a .bak extension in the current directories
and those inside it. {} is replaced with the matching file name when the
command (rm) is run and ; ends the command to be run: it has to be
escaped as shown so it will be included as the end of the -exec command
rather that the shell taking it as the end of the 'find' command.

[1] cron normally runs the jobs in /etc/cron.daily around 3AM but, if
the computer isn't running then, it will remember that some jobs haven't
been run when its next started and will run them some time on the next
hour or two.

Martin
User avatar
DanKegel
Moderator
Moderator
Posts: 1164
Joined: Wed May 14, 2008 11:44 am

Post by DanKegel »

Geez. It's not that hard.

I usually make an fstab entry to always mount the remote
filesystem in, say, /net/hostname/sharename,
then make a drive letter with a symlink, e.g.
ln -s /net/fooserver/fooshare ~/.wine/dos_devices/g:

For how to make that fstab entry, see e.g.
http://www.cyberciti.biz/faq/configure- ... -etcfstab/
or
http://opensuse.swerdna.org/susesambacifs.html
jorl17
Level 5
Level 5
Posts: 365
Joined: Mon Jul 28, 2008 6:44 pm

Re: Windows and Ubuntu and Windows and......

Post by jorl17 »

Martin Gregorie wrote:On Sat, 2011-08-27 at 14:32 -0500, jorl17 wrote:
locate is another utility similar to find but that uses indexing
(someone correct me if that's wrong) to make it work faster
'locate' is fast because it searches a database of all the filenames in
the system. The database is rebuilt on a daily basis when the cron
daemon runs 'updatedb' via the mlocate.cron script [1], so it can can be
up to 24 hours out of date. The command 'locate text' will list all the
files or directories that have 'text' anywhere in their absolute
pathname, i.e. if you wanted to find a file called recipes_etc and
entered the command 'locate etc', locate would list it if it existed
when updatedb was last run but would also list the several hundred files
in the /etc directory structure. 'locate' is very fast because all the
text it searches is gathered into one place but you have to be aware
that its never fully up to date, that it is matching on absolute path
names and that it always looks at every filename anywhere in your
system.

'find', on the other hand, is a lot slower because it has to read
through all the directories its been asked to search but is always
up-to-date because it is looking directly at the filing system. It has
fewer gotchas because of this. It can also search just a selected part
of the filing system. e.g. if you are on your $HOME directory, running

find . -name '*etc*'

will only search the current directory ('.') and all the directories
within it. Specifying the search text as '*etc*' is necessary to find
files containing 'etc'. If you just asked for 'find . -name etc' it
would only find files and directories whose name is 'etc' and only
'etc'. If you put globs (* matches zero or more characters) or question
marks (? matches a single character in that position) in the search
pattern you should enclose them in single quotes to prevent the shell
from expanding them.

Find is extremely versatile: it understands and can use file creation
time or last access time as search terms and can also run commands
against matching files:

find . -name '*.bak' -exec rm {} \;

will delete all files with a .bak extension in the current directories
and those inside it. {} is replaced with the matching file name when the
command (rm) is run and ; ends the command to be run: it has to be
escaped as shown so it will be included as the end of the -exec command
rather that the shell taking it as the end of the 'find' command.

[1] cron normally runs the jobs in /etc/cron.daily around 3AM but, if
the computer isn't running then, it will remember that some jobs haven't
been run when its next started and will run them some time on the next
hour or two.

Martin
Exactly, thanks. That's pretty much what I meant with "indexing", though it was not the right term at all.

The point is that OP has to understand how all these tools work and how his/her OS is built. These commands that we've all learned to use are pretty much gibberish talk to OP. Thanks Martin, that was a really good explanation for OP!
David Bailey
Level 2
Level 2
Posts: 14
Joined: Thu Jun 02, 2011 11:11 am

Post by David Bailey »

I too have enormous sympathy for the OP - mainly because I am just starting to feel a bit less of a Linux newbie than I was.

The thing to realise is that when you use samba to network windows file store into linux, it appears as an extension to the linux files store. So suppose you do the mount commands manually to begin with, you can create an empty directory somewhere and mount the samba file store inside it. So say you create ~/Windows as a directory, you can mount the samba file store inside that directory:

sudo mount -t cifs //192.168.1.7/drive_c /home/dave/Windows -o username=dave,noexec

(Change details as appropriate)

(I am not sure what all the options do (yet), but this works for me).

I recommend that you do that, and then explore the resultant file store, by CD-ing into ~/Windows and using the ls command. Once you realise how it works, you can probably dispense with setting up a G: drive, and just point the program to the data directly.

David
jorl17
Level 5
Level 5
Posts: 365
Joined: Mon Jul 28, 2008 6:44 pm

Post by jorl17 »

David Bailey wrote:I too have enormous sympathy for the OP - mainly because I am just starting to feel a bit less of a Linux newbie than I was.

The thing to realise is that when you use samba to network windows file store into linux, it appears as an extension to the linux files store. So suppose you do the mount commands manually to begin with, you can create an empty directory somewhere and mount the samba file store inside it. So say you create ~/Windows as a directory, you can mount the samba file store inside that directory:

sudo mount -t cifs //192.168.1.7/drive_c /home/dave/Windows -o username=dave,noexec

(Change details as appropriate)

(I am not sure what all the options do (yet), but this works for me).

I recommend that you do that, and then explore the resultant file store, by CD-ing into ~/Windows and using the ls command. Once you realise how it works, you can probably dispense with setting up a G: drive, and just point the program to the data directly.

David
Also, OP may not know that "~" is replaced by the shell to become $HOME. So you can say that ~ has the same effect as $HOME.

One should note that using this technique you will not seethe share "mounted" in your graphical file browser, even though you can manually navigate there.

But this is getting extremely out of the range of Wine's forums/mailing list and I think we should wait for OP to see if it doesn't get too offtopic.

Cheers,

Jorl17
ubudunce
Level 2
Level 2
Posts: 12
Joined: Sat Aug 27, 2011 2:41 am

Post by ubudunce »

Thanks for all your help guys - all including the "gibberish" :D

I believe I have now got it resolved with the help of a guy that talked me through it over the phone :D Thanks Rhizoid.
If you don't mind, i am linking to the Ubuntu forum where he has put up the fix (which you, most likely, all knew for any, like me, that couldn't hack it)

http://ubuntuforums.org/showthread.php? ... st11189905
Locked