From 4664930e061975f33acfdef84fd978a9a704395b Mon Sep 17 00:00:00 2001 From: Seth Vargo Date: Wed, 22 Jun 2016 18:34:37 -0700 Subject: [PATCH] guests/ubuntu: Use short hostname Fixes GH-7488 --- plugins/guests/ubuntu/cap/change_host_name.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/guests/ubuntu/cap/change_host_name.rb b/plugins/guests/ubuntu/cap/change_host_name.rb index bbcada3e7..64dcd4151 100644 --- a/plugins/guests/ubuntu/cap/change_host_name.rb +++ b/plugins/guests/ubuntu/cap/change_host_name.rb @@ -9,11 +9,11 @@ module VagrantPlugins basename = name.split(".", 2)[0] comm.sudo <<-EOH.gsub(/^ {14}/, '') # Set the hostname - echo '#{name}' > /etc/hostname + echo '#{basename}' > /etc/hostname hostname -F /etc/hostname if command -v hostnamectl; then - hostnamectl set-hostname '#{name}' + hostnamectl set-hostname '#{basename}' fi # Remove comments and blank lines from /etc/hosts