Can not ssh to raring VM's using hostname

Bug #1084064 reported by Para Siva
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
network-manager (Ubuntu)
Fix Released
High
Mathieu Trudel-Lapierre

Bug Description

It is impossible to ssh to a raring desktop vm using the hostname except the ip. It is required to manually edit /etc/hostname and /etc/hosts to include the domain name (.local) inorder for the ssh connection using the hostname to succeede.

1. Install raring desktop vm using libvirt on a precise or quantal host (20121128-amd64)
2. Install openssh-server on the vm
3. ssh to the vm from the host using the hostname (attempting with .local and without .local fails)

ProblemType: Bug
DistroRelease: Ubuntu 13.04
Package: network-manager 0.9.6.0+git201211131441.e9e2c56-0ubuntu2
ProcVersionSignature: Ubuntu 3.7.0-4.12-generic 3.7.0-rc7
Uname: Linux 3.7.0-4-generic x86_64
ApportVersion: 2.6.2-0ubuntu5
Architecture: amd64
CRDA: Error: command ['iw', 'reg', 'get'] failed with exit code 1: nl80211 not found.
Date: Wed Nov 28 12:45:54 2012
IfupdownConfig:
 # interfaces(5) file used by ifup(8) and ifdown(8)
 auto lo
 iface lo inet loopback
InstallationDate: Installed on 2012-11-28 (0 days ago)
InstallationMedia: Ubuntu 13.04 "Raring Ringtail" - Alpha amd64 (20121128)
IpRoute:
 default via 192.168.122.1 dev eth0 proto static
 169.254.0.0/16 dev eth0 scope link metric 1000
 192.168.122.0/24 dev eth0 proto kernel scope link src 192.168.122.197 metric 1
IwConfig:
 eth0 no wireless extensions.

 lo no wireless extensions.
MarkForUpload: True
NetworkManager.state:
 [main]
 NetworkingEnabled=true
 WirelessEnabled=true
 WWANEnabled=true
 WimaxEnabled=true
RfKill:

SourcePackage: network-manager
UpgradeStatus: No upgrade log present (probably fresh install)
nmcli-con:
 NAME UUID TYPE TIMESTAMP TIMESTAMP-REAL AUTOCONNECT READONLY DBUS-PATH
 Wired connection 1 0310d219-ab38-445f-8771-fdd7cad7392a 802-3-ethernet 1354106562 Wed 28 Nov 2012 12:42:42 GMT yes no /org/freedesktop/NetworkManager/Settings/0
nmcli-dev:
 DEVICE TYPE STATE DBUS-PATH
 eth0 802-3-ethernet connected /org/freedesktop/NetworkManager/Devices/0
nmcli-nm:
 RUNNING VERSION STATE NET-ENABLED WIFI-HARDWARE WIFI WWAN-HARDWARE WWAN
 running 0.9.7.0 connected enabled enabled enabled enabled disabled

Revision history for this message
Para Siva (psivaa) wrote :
summary: - hostname of raring desktop vm does not match the entries /etc/hostname &
- /etc/hosts
+ hostname of raring desktop vm does not match the entries in
+ /etc/hostname & /etc/hosts
Revision history for this message
Para Siva (psivaa) wrote : Re: hostname of raring desktop vm does not match the entries in /etc/hostname & /etc/hosts

Logs related to avahi-daemon using the host name with (.local) domain name is attached

ubuntu@ubuntu2-virtual-machine:/var/log$ cat syslog | grep '\.local'
Nov 28 12:37:36 ubuntu2-virtual-machine avahi-daemon[643]: Server startup complete. Host name is ubuntu2-virtual-machine.local. Local service cookie is 4005645905.

Para Siva (psivaa)
summary: - hostname of raring desktop vm does not match the entries in
- /etc/hostname & /etc/hosts
+ Can not ssh to raring VM's using hostname
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in network-manager (Ubuntu):
status: New → Confirmed
Revision history for this message
Gema Gomez (gema) wrote :

This bug is affecting smoke testing and the testability of the images, it is a regression first spotted on November 22nd.

Changed in network-manager (Ubuntu):
importance: Undecided → High
tags: added: rls-r-incoming
Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

On what system do you add that .local? You shouldn't have to add it anywhere, and in fact it's totally wrong to do so.

I'm still not exactly sure what you're trying to achieve. If I understand correctly, you're on a raring host, and from that host you're trying to access to virtual machines (using lxc? libvirt? virtualbox?) under that host?

If it's the case, it wouldn't be a regression. I'm pretty sure it was already the case previously, and it's up to $hypervisor to tell NetworkManager and dnsmasq how to interrogate its own instance of dnsmasq to get to the VMs.

Changed in network-manager (Ubuntu):
status: Confirmed → Incomplete
Para Siva (psivaa)
description: updated
Revision history for this message
Para Siva (psivaa) wrote :

What I am trying to do is to ssh to VMs installed using libvirt from precise/ quantal hosts. I have updated the steps to be clearer.

I am able to ssh to a VM with 20121108.2 i386 raring image installed using libvirt without any issues .
    'ssh ubuntu@ubuntu-virtual-machine' connects fine to this machine without any issues from my quantal host.

But a VM installed with today's image (20121128) on the same host, same libvirt is not connecting in a similar way. It was attempted to add .local since the output of hostname -A did not match to the entries in /etc/hosts and /etc/hostname.
( I had to change the entries to match them, purge openssh-server, reboot the VM, install openssh-server again and then reboot the VM in order to make my ssh from the same host to work and I did NOT have to do all these things for the VM with the old image said above (20121108.2).
I think that indicates a regression.

Changed in network-manager (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Para Siva (psivaa) wrote :

OK, here's what I have found lately,
To the VM's created using an old image raring-desktop-i386 -20121108.2 i386 (using libvirt on quantal host) I can ssh fromt he same host using
                                ssh ubuntu@ubuntu-virtual-machine

But to the VM's crated using the latest images -20121129 ( using the same method as the old VM was created) I can not ssh using the same command but instead i need to add a .local at the end of the host name
       i.e. in the new VMs
                             ssh ubuntu@ubuntu-virtual-machine does NOT work
   but instead ssh <email address hidden> DOES work

NB: openssh-server was installed on the VMs soon after the installation of VMs

Revision history for this message
Paul Larson (pwlars) wrote :

ignore the .local stuff, that's just avahi madness and doesn't seem to be related. Here's what I'm seeing locally when I try this:
I'm noticing from the dnsmasq server that in the leases file, if I start a quantal vm I see the hostname. I also see the hostname pop up in the syslog. If I start up a raring vm though, I don't see the hostname ever come across. I went to a raring vm and ran dhclient by hand, and everything worked. The hostname was sent with the dhcp request, and I could access the system by sshing or pinging the hostname alone. Running dhcpclient alone uses the default config under /etc though. With NetworkManager in the picture though, a different config file is used:

$ ps -ef |grep dhclient
root 733 693 0 21:44 ? 00:00:00 /sbin/dhclient -d -4 -sf /usr/lib/NetworkManager/nm-dhcp-client.action -pf /run/sendsigs.omit.d/network-manager.dhclient-eth0.pid -lf /var/lib/dhclient/dhclient-0f1c7278-f6f0-4447-a3a7-40c0c7c300d6-eth0.lease -cf /var/run/nm-dhclient-eth0.conf eth0

$ cat /var/run/nm-dhclient-eth0.conf
# Created by NetworkManager

option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;
option ms-classless-static-routes code 249 = array of unsigned integer 8;
option wpad code 252 = string;

also request rfc3442-classless-static-routes;
also request ms-classless-static-routes;
also request wpad;
also request ntp-servers;

If I look another system I have, I see the addition of this line in that file:
send host-name "myhostname"; # added by NetworkManager

So it looks like nm is generating this file without putting the line in to send the hostname.

Revision history for this message
Javier Collado (javier.collado) wrote :

Note that networkmanager 0.9.6.0+git201211131441.e9e2c56-0ubuntu2 was published
on 2012-11-21 and we started to get problems in our testing on 2012-11-22.

Looking at the last image that worked fine, I can see that the new version
number didn't make it into that image, so it seems that there is some
correlation with the problem (even though according to the changelog the only
thing that was modified was a timeout).

Revision history for this message
Javier Collado (javier.collado) wrote :

The info file contents for the distro I'm talking about is (desktop amd64):
Ubuntu 13.04 "Raring Ringtail" - Alpha amd64 (20121121.1)

and the manifest, in case you want to take a look at it, is attached.

Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

Turns out it's a "new" bug in the dhcp manager code; fixing it right now...

Changed in network-manager (Ubuntu):
status: Confirmed → In Progress
assignee: nobody → Mathieu Trudel-Lapierre (mathieu-tl)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package network-manager - 0.9.6.0+git201211131441.e9e2c56-0ubuntu3

---------------
network-manager (0.9.6.0+git201211131441.e9e2c56-0ubuntu3) raring; urgency=low

  * debian/patches/send_hostname_for_default_connection.patch: always send
    the hostname to the DHCP server if we're activating a default, automatic
    wired connection. (LP: #1084064)
 -- Mathieu Trudel-Lapierre <email address hidden> Tue, 04 Dec 2012 12:45:24 -0500

Changed in network-manager (Ubuntu):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.