XP Home under kvm/qemu. Cannot access share on host with 'net use e: \\ ...... It demands un/passord and all are rejected.

Asked by Roger Denison on 2007-09-20

I have installed a virtual Windows XP Home under kvm/qemu and it boots up ok.

I have installed samba on the host (feisty).

In XP Home I have used the Command Prompt and entered:-
    'net use e: \\10.0.0.2\share' -- share is a directory under my home dir in Linux.

It asks for a Username and Password, but whatever I supply it rejects with
error 1326 Login failure: bad username or invalid password.

Where am I going wrong? What username is it expecting, my Linux one or what?

Many thanks,
Roger Denison

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Roger Denison
Solved:
2007-10-02
Last query:
2007-10-02
Last reply:
2007-09-30
Massimo Forti (slackwarelife) said : #1

thanks for your question. I want to know the result of this command on dos prompt:

ipconfig

Post the result, thanks many

Roger Denison (roger-denison) said : #2

Hi Massimo,

Here is the result of ipconfig
Connection-specific DNS Suffix
IP Address......................: 10.0.2.15
Subnet Mask..................: 255.255.255.0
Default Gateway...........: 10.0.2.2

Hope this helps, and many thanks
Roger Denison

Massimo Forti (slackwarelife) said : #3

Ok, thanks for the post... I thing your problem is the ip address of this command:

net use e: \\10.0.0.2\share

your default hìgeteway has 10.0.2.2, probably you must use it to enter in your samba share

Roger Denison (roger-denison) said : #4

Hi again,

Sorry, my original post had a typo - I was using 'net use e: \\10.0.2.2\share' all the time.
(Can you get dyslexia in your 60s ??)

The problem remains, however - error 1326 - unknown username or bad password.

incidentally, if I user 10.0.2.15 (the IP address, Error 53 (network path not found),
and if I use the typo (10.0.0.2) it just hangs until I ^C it, so at least net is recognising some sort of difference in the addresses.

Cheers,
Roger

Massimo Forti (slackwarelife) said : #5

Post the result of ipconfig -all, this command let know more info about your network configuration. Thanks

Roger Denison (roger-denison) said : #6

Here it is - I had to Email it to myself from the windows incarnation to the Ubuntu setup.

Windows IP Configuration

        Host Name . . . . . . . . . . . . : roger

        Primary Dns Suffix . . . . . . . :

        Node Type . . . . . . . . . . . . : Unknown

        IP Routing Enabled. . . . . . . . : No

        WINS Proxy Enabled. . . . . . . . : No

Ethernet adapter Local Area Connection:

        Connection-specific DNS Suffix . :

        Description . . . . . . . . . . . : Realtek RTL8029(AS)-based Ethernet Adapter (Generic)

        Physical Address. . . . . . . . . : 52-54-00-12-34-56

        Dhcp Enabled. . . . . . . . . . . : Yes

        Autoconfiguration Enabled . . . . : Yes

        IP Address. . . . . . . . . . . . : 10.0.2.15

        Subnet Mask . . . . . . . . . . . : 255.255.255.0

        Default Gateway . . . . . . . . . : 10.0.2.2

        DHCP Server . . . . . . . . . . . : 10.0.2.2

        DNS Servers . . . . . . . . . . . : 10.0.2.3

        Lease Obtained. . . . . . . . . . : 21 September 2007 16:51:30

        Lease Expires . . . . . . . . . . : 22 September 2007 16:51:30

Massimo Forti (slackwarelife) said : #7

I have read the qemu documentation and I have understood this:

QEMU VLAN <------> Firewall/DHCP server <-----> Internet
                           | (10.0.2.2)
                           |
                           ----> DNS server (10.0.2.3)
                           |
                           ----> SMB server (10.0.2.4)

Probably your samba server has 10.0.2.4 ip address. Use it and let me know. Thanks

Roger Denison (roger-denison) said : #8

Sorry Massimo - 10.0.2.4 gives exactly the same result as 10.0.2.2

Roger

Massimo Forti (slackwarelife) said : #9

Sorry for my delay

Moving data between host and guest OS
If you have servers on your host OS they will be accessible with the ip-address 10.0.2.2 without any further configuration. So you could just FTP or SSH, etc to 10.0.2.2 from windows to share data, or if you would like to use samba:

Samba
Qemu supports SAMBA which allows you to mount host directories during the emulation. It seems that there is an incompatibility with SAMBA 3.x. and some versions of qemu. But at least with a current snapshot of qemu it should be working.

First, you need to have a working samba installation. Then add the following section to your smb.conf:

[qemu]
   comment = Temporary file space
   path = /tmp
   read only = no
   public = yes
Now start qemu with:

qemu [hd_image] -smb qemu
Then you should be able to access your host's smb-server with the ip-address 10.0.2.2. If you're running Win9x as guest OS, you may need to add

10.0.2.2 smbserver
to c:\windows\lmhosts (Win9x has Lmhosts.sam as a SAMple, rename it!).

I have found it here:

http://wiki.archlinux.org/index.php/Qemu

Let me know. Thanks

Roger Denison (roger-denison) said : #10

I've tried your suggestion without much success. but there are some changes.

Now when I run 'net use e: \\10.0.2.2\share' and give it my Linux UN/PW it comes back with:-
System Error 5 - Access is denied.

Similarly, if I do 'ftp 10.0.2.2' I get:-
Connected to 10.0.2.2 followed immediately by
Connection closed by remote host.

Ive set the Linux directory I want to share ($HOME/share) to be shared by smb, but this has made no difference.

One question I have is ;-

In the 'net use e: \\10.0.2.2\share' command, does the \share bit imply a directory called 'share' under the home directory of the user I am trying to log in as, or does it take things from the root of the linux file system, which would require:-
net use e: \\10.0.2.2\home\myusername\share.

Also, what is the effect of adding a path of /tmp to the smb.conf file if that is not the directory I want to share?

Massimo Forti (slackwarelife) said : #11

Can you post your linux samba config file please ??? I want to see the share config. Thanks

Roger Denison (roger-denison) said : #12

#======================= Global Settings =======================
Here are the non-comment lines.

[global]
        log file = /var/log/samba/log.%m
        name resolve order = lmhosts host wins bcast
        passwd chat = *Enter\snew\sUNIX\spassword:* %n\n *Retype\snew\sUNIX\spassword:* %n\n *password\supdated\ssuccessfully* .
        map hidden = yes
        socket options = TCP_NODELAY
        obey pam restrictions = yes
        write list = dave2,@dave2
        interfaces = 127.0.0.0/8 eth0
        user = dave2,@dave2
        passwd program = /usr/bin/passwd %u
        passdb backend = tdbsam
        wins support = yes
        dns proxy = no
        netbios name = ubuntu
        map system = yes
        server string = %h server (Samba, Ubuntu)
        invalid users = root
        default = dave2
        only user = yes
        path = /home/dave2/share
        workgroup = MSHOME
        os level = 20
        valid users = dave2,@dave2
        syslog = 0
        security = user
        panic action = /usr/share/samba/panic-action %d
        max log size = 1000
[printers]
   comment = All Printers
   browseable = no
   path = /tmp
   printable = yes
   public = no
   writable = no
   create mode = 0700
[print$]
   comment = Printer Drivers
   path = /var/lib/samba/printers
   browseable = yes
   read only = yes
   guest ok = no

[homes]
        path = /home/dave2/share

[rog2]
        path = /home/dave2
available = yes
browsable = yes
public = yes
writable = yes
[qemu]
  comment = Temporary file space
  path = /tmp
  read only = no
  public = yes
available = yes
browsable = yes
writable = yes

[share]
path = /home/dave2/share
available = yes
browsable = yes
public = yes
writable = yes

Roger Denison (roger-denison) said : #13

Hi Massimo,

I've made s breakthrough!

Changing the NETBIOS name to dave2-desktop, to match the Server Name which I previously set in Samba (using Webmin) seems to have sorted it out a treat.

Many thanks for you help, which set me reading up more thoroughly and allowed me to make a bit more sense of how Samba works.

Cheers, Roger