<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>scripting Archives - VirtJunkie</title>
	<atom:link href="/tag/scripting/feed/" rel="self" type="application/rss+xml" />
	<link>/tag/scripting/</link>
	<description>Virtualization, Automation, and anything else that might be on my mind</description>
	<lastBuildDate>Mon, 26 Nov 2018 02:52:25 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.5.5</generator>

<image>
	<url>/wp-content/uploads/2020/04/cropped-vj4-150x150.png</url>
	<title>scripting Archives - VirtJunkie</title>
	<link>/tag/scripting/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Prompt For A New Hostname on Boot</title>
		<link>/2018/11/25/prompt-for-a-new-hostname-on-boot/</link>
					<comments>/2018/11/25/prompt-for-a-new-hostname-on-boot/#comments</comments>
		
		<dc:creator><![CDATA[Jon]]></dc:creator>
		<pubDate>Mon, 26 Nov 2018 02:52:25 +0000</pubDate>
				<category><![CDATA[Automation]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[ubuntu]]></category>
		<guid isPermaLink="false">http://www.virtjunkie.com/?p=657</guid>

					<description><![CDATA[<p>I&#8217;ve been brushing up on a few technologies in my home lab, and have found myself using VMware workstation for some simple tasks that don&#8217;t require a whole virtualized environment. Workstation didn&#8217;t set the hostname of my Ubuntu 18.xx VMs properly after they booted. Maybe I&#8217;m a little spoiled by guest OS customization or missing [&#8230;]</p>
<p>The post <a href="/2018/11/25/prompt-for-a-new-hostname-on-boot/">Prompt For A New Hostname on Boot</a> appeared first on <a href="/">VirtJunkie</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>I&#8217;ve been brushing up on a few technologies in my home lab, and have found myself using VMware workstation for some simple tasks that don&#8217;t require a whole virtualized environment. Workstation didn&#8217;t set the hostname of my Ubuntu 18.xx VMs properly after they booted. Maybe I&#8217;m a little spoiled by guest OS customization or missing something, but either way, I needed a way to quickly spin up a whole VM and have it&#8217;s hostname set correctly. It&#8217;s definitely not the cleanest, and I realize I would be better off using the Workstation Pro REST API, but I&#8217;m not there yet.</p>
<p><span id="more-657"></span></p>
<p>We can do this pretty easily by adding a script to the /etc/profile.d directory. The script I&#8217;m currently using is below:</p><pre class="urvanov-syntax-highlighter-plain-tag">#!/bin/bash
#file /etc/profile.d/VirtJunkie.com-set_hostname.sh
FLAG="/var/log/firstboot.flag"
if [ ! -f $FLAG ]; then
    echo "Server will reboot after this process completes"
    echo -n "Current hostname is $(hostname). Enter the new hostname and press [ENTER]: "
    read newhostname
    sudo hostnamectl set-hostname $newhostname

    #the next line creates an empty file so it won't run the next boot
    sudo touch $FLAG
    sudo reboot now
fi</pre><p>Just modify your parent image, clone your test VMs, and this will prompt you to set a new hostname the first time you log in.</p>
<p>The post <a href="/2018/11/25/prompt-for-a-new-hostname-on-boot/">Prompt For A New Hostname on Boot</a> appeared first on <a href="/">VirtJunkie</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>/2018/11/25/prompt-for-a-new-hostname-on-boot/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
