Can not ssh to raring VM's using hostname

Bug #1084064 reported by Para Siva on 2012-11-28
This bug affects 3 people
Affects Status Importance Assigned to Milestone
network-manager (Ubuntu)
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
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
 # 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)
 default via dev eth0 proto static dev eth0 scope link metric 1000 dev eth0 proto kernel scope link src metric 1
 eth0 no wireless extensions.

 lo no wireless extensions.
MarkForUpload: True

SourcePackage: network-manager
UpgradeStatus: No upgrade log present (probably fresh install)
 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
 eth0 802-3-ethernet connected /org/freedesktop/NetworkManager/Devices/0
 running connected enabled enabled enabled enabled disabled

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

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) on 2012-11-28
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
Launchpad Janitor (janitor) wrote :

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

Changed in network-manager (Ubuntu):
status: New → Confirmed
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

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) on 2012-11-28
description: updated
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
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

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/ -lf /var/lib/dhclient/ -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.

Javier Collado (javier.collado) wrote :

Note that networkmanager 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).

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.

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)
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package network-manager -

network-manager ( 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  Edit
Everyone can see this information.

Other bug subscribers