<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Vagrant on Puppeteers Oy</title>
		<link>https://www.puppeteers.net/tags/vagrant/</link>
		<description>Recent content in Vagrant on Puppeteers Oy</description>
		<generator>Hugo</generator>
		<language>en-US</language>
		
		
		
		
			<lastBuildDate>Sun, 31 Oct 2021 00:00:00 +0000</lastBuildDate>
		
			<atom:link href="https://www.puppeteers.net/tags/vagrant/index.xml" rel="self" type="application/rss+xml" />
			<item>
				<title>Short introduction to Packer and Vagrant</title>
				<link>https://www.puppeteers.net/blog/short-introduction-to-packer-and-vagrant/</link>
				<pubDate>Sun, 31 Oct 2021 00:00:00 +0000</pubDate>
				<guid>https://www.puppeteers.net/blog/short-introduction-to-packer-and-vagrant/</guid>
				<description>&lt;p&gt;This article is a short introduction to Packer and Vagrant - tools that we often recommend to our customers but which may be a bit hard to understand if you have no previous expose to them.&lt;/p&gt;&#xA;&lt;h2 id=&#34;packer&#34;&gt;Packer&lt;/h2&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://www.packer.io/&#34;&gt;Packer&lt;/a&gt; is used to “create identical machine images for multiple platforms from a single source configuration”. Packer works in a very simple fashion:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;It reads its configuration file&lt;/li&gt;&#xA;&lt;li&gt;It launches a virtual machine based on the “base box” you’ve defined. The base box would be a “vanilla” Linux distribution such as Ubuntu 20.04.&lt;/li&gt;&#xA;&lt;li&gt;It runs the provisioning scripts you’ve written on the base box (via SSH)&lt;/li&gt;&#xA;&lt;li&gt;It removes deployment-specific things (e.g. SSH host keys)&lt;/li&gt;&#xA;&lt;li&gt;It shuts down the VM&lt;/li&gt;&#xA;&lt;li&gt;It creates a VM image out of base box + your changes&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;After this you can distribute the base box to people and they will have an identical system at their disposal. If you need to modify the image you can just change the provisioning scripts and/or the base image and rebuild. The configuration file can and should be stored in version control repository.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Using xfreerdp with Vagrant</title>
				<link>https://www.puppeteers.net/blog/using-xfreerdp-with-vagrant/</link>
				<pubDate>Tue, 15 Jun 2021 00:00:00 +0000</pubDate>
				<guid>https://www.puppeteers.net/blog/using-xfreerdp-with-vagrant/</guid>
				<description>&lt;p&gt;Vagrant has built-in support for connecting to Windows VMs using the &lt;a href=&#34;https://www.vagrantup.com/docs/cli/rdp&#34;&gt;vagrant rdp command&lt;/a&gt;. It does basically does the same as &lt;a href=&#34;https://www.vagrantup.com/docs/cli/ssh&#34;&gt;vagrant ssh&lt;/a&gt; for Linux VMs. There are a few shortcomings, though: vagrant rdp fails to automatically accept the host key of the VM it is connecting to, at least when using it from Linux with xfreerdp. So, you first need to connect to the VM directly once with raw xfreerdp, then vagrant rdp will start working. Then, when you wipe out the VM, you need to repeat the process again. If you have a high resolution screen you will also notice that vagrant rdp will give you a tiny Windows desktop where you need a magnifying glass to read the text.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Making Vagrant work on Fedora 34</title>
				<link>https://www.puppeteers.net/blog/making-vagrant-work-on-fedora-34/</link>
				<pubDate>Tue, 01 Jun 2021 00:00:00 +0000</pubDate>
				<guid>https://www.puppeteers.net/blog/making-vagrant-work-on-fedora-34/</guid>
				<description>&lt;p&gt;We use Vagrant and Virtualbox a lot because it is an excellent tool for infrastructure code development. Unfortunately it is also very prone to breakage during operating system upgrades, especially if you depend on many plugins. When I upgraded from Fedora 32 to 34 Vagrant broken even more than usual due to conflicting rspec dependencies. Basically every Vagrant plugin refused to install with this error message:&lt;/p&gt;&#xA;&lt;div class=&#34;code-block&#34;&gt;&#xA;    &lt;button class=&#34;code-copy&#34; type=&#34;button&#34; hidden aria-label=&#34;Copy code to clipboard&#34;&gt;&#xA;      &lt;span class=&#34;code-copy-label&#34; aria-hidden=&#34;true&#34;&gt;Copy&lt;/span&gt;&#xA;    &lt;/button&gt;&#xA;    &lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$ vagrant plugin install vagrant-vbguest&#xA;Installing the &amp;#39;vagrant-vbguest&amp;#39; plugin. This can take a few minutes...&#xA;&#xA;Vagrant failed to properly resolve required dependencies. These&#xA;errors can commonly be caused by misconfigured plugin installations&#xA;or transient network issues. The reported error is:&#xA;&#xA;conflicting dependencies rspec (= 3.10.0) and rspec (= 2.14.1)&#xA;  Activated rspec-2.14.1&#xA;  which does not match conflicting dependency (= 3.10.0)&#xA;&#xA;  Conflicting dependency chains:&#xA;    rspec (= 2.14.1), 2.14.1 activated&#xA;&#xA;  versus:&#xA;    rspec (= 3.10.0)&#xA;&#xA;  Gems matching rspec (= 3.10.0):&#xA;    rspec-3.10.0&lt;/code&gt;&lt;/pre&gt;&#xA;  &lt;/div&gt;&lt;p&gt;The rspec dependency conflict does not sound particularly scary for somebody who is not &lt;em&gt;developing&lt;/em&gt; Vagrant or Vagrant plugins. Therefore ignoring the dependencies is likely to be just fine:&lt;/p&gt;</description>
			</item>
			<item>
				<title>What Vagrant plugins actually are?</title>
				<link>https://www.puppeteers.net/blog/what-vagrant-plugins-actually-are/</link>
				<pubDate>Tue, 01 Jun 2021 00:00:00 +0000</pubDate>
				<guid>https://www.puppeteers.net/blog/what-vagrant-plugins-actually-are/</guid>
				<description>&lt;p&gt;This was a revelation that came to me &lt;a href=&#34;https://www.puppeteers.net/blog/making-vagrant-work-on-fedora-34/&#34;&gt;when fixing Vagrant on my Fedora 34 laptop&lt;/a&gt;: Vagrant plugins seem to be just Ruby gems installed into an isolated runtime environment, with &amp;ldquo;vagrant plugin&amp;rdquo; ensuring that the gems are installed in the correct place.&lt;/p&gt;&#xA;&lt;p&gt;The same gems that you can install with &amp;ldquo;vagrant plugiin install&amp;rdquo; can be found using vanilla gem command:&lt;/p&gt;&#xA;&lt;div class=&#34;code-block&#34;&gt;&#xA;    &lt;button class=&#34;code-copy&#34; type=&#34;button&#34; hidden aria-label=&#34;Copy code to clipboard&#34;&gt;&#xA;      &lt;span class=&#34;code-copy-label&#34; aria-hidden=&#34;true&#34;&gt;Copy&lt;/span&gt;&#xA;    &lt;/button&gt;&#xA;    &lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$ vagrant plugin list&#xA;rexml (3.2.5, global)&#xA;vagrant-hostmanager (1.8.9, global)&#xA;vagrant-vbguest (0.29.0, global)&#xA;winrm (2.3.6, global)&#xA;winrm-elevated (1.2.3, global)&#xA;winrm-fs (1.3.5, global)&#xA;&#xA;$ gem info --remote rexml&#xA;&#xA;*** REMOTE GEMS ***&#xA;&#xA;rexml (3.2.5)&#xA;    Author: Kouhei Sutou&#xA;    Homepage: https://github.com/ruby/rexml&#xA;&#xA;    An XML toolkit for Ruby&#xA;&#xA;$ gem info --remote vagrant-vbguest&#xA;&#xA;*** REMOTE GEMS ***&#xA;&#xA;vagrant-vbguest (0.29.0)&#xA;    Author: Robert Schulze&#xA;    Homepage: https://github.com/dotless-de/vagrant-vbguest&#xA;&#xA;    A Vagrant plugin to install the VirtualBoxAdditions into the guest&#xA;    VM&#xA;&#xA;$ gem list|grep vagrant&#xA;&amp;lt;no output&amp;gt;&lt;/code&gt;&lt;/pre&gt;&#xA;  &lt;/div&gt;&lt;p&gt;On the remote side you can find all the familiar Vagrant plugins as gems, but vanilla gem won&amp;rsquo;t find them installed locally, because they&amp;rsquo;re in a different path.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Passing Vagrant parameters to Puppet Litmus</title>
				<link>https://www.puppeteers.net/blog/passing-vagrant-parameters-to-puppet-litmus/</link>
				<pubDate>Sun, 07 Mar 2021 00:00:00 +0000</pubDate>
				<guid>https://www.puppeteers.net/blog/passing-vagrant-parameters-to-puppet-litmus/</guid>
				<description>&lt;p&gt;Puppet Litmus allows creating SUTs (&amp;ldquo;System Under Test&amp;rdquo;) with Vagrant using Virtualbox or Hyper-V as the virtualization backend. However, the default virtual machine settings like 1024MB of memory are only suitable for very simple modules and applications. For example, Litmus testing our &lt;a href=&#34;https://github.com/Puppet-Finland/puppet-puppetmaster&#34;&gt;puppetmaster-installer&lt;/a&gt; will fail with the default settings.&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://puppetlabs.github.io/litmus/Litmus-core-commands.html&#34;&gt;Litmus documentation&lt;/a&gt; tells us that you can define parameters in provision.yaml which get then converted to environment variables. What it does not tell what to use these environment variables for. Looking at the Vagrant code in Litmus you can see that those environment variables can be used to drive the Virtualbox settings, among other things:&lt;/p&gt;</description>
			</item>
			<item>
				<title>Fixing foreman-installer &#34;Forward DNS points to x&#34; errors</title>
				<link>https://www.puppeteers.net/blog/fixing-foreman-installer-forward-dns-points-to-errors/</link>
				<pubDate>Wed, 03 Mar 2021 00:00:00 +0000</pubDate>
				<guid>https://www.puppeteers.net/blog/fixing-foreman-installer-forward-dns-points-to-errors/</guid>
				<description>&lt;p&gt;This posting comes strictly from the land of esoteria. We have a &lt;a href=&#34;https://www.vagrantup.com/&#34;&gt;Vagrant&lt;/a&gt; + &lt;a href=&#34;https://www.virtualbox.org/&#34;&gt;Virtualbox&lt;/a&gt; environment that sets up &lt;a href=&#34;https://theforeman.org/&#34;&gt;Foreman&lt;/a&gt; used for &lt;a href=&#34;https://www.howtogeek.com/57601/what-is-network-booting-pxe-and-how-can-you-use-it/&#34;&gt;PXE booting&lt;/a&gt; baremetal servers. The environment work fine on Linux and MacOS. But we needed to make this environment work also on Windows. Easy, right? Vagrant and Virtualbox are supposed to abstract all those pesky operating system settings away, correct? After resolving a &lt;a href=&#34;https://www.puppeteers.net/blog/fixing-vagrant-vbguest-for-the-centos-7-base-box/&#34;&gt;non-Windows related challenge&lt;/a&gt; provisioning of Foreman on Windows almost worked. Except that it failed when foreman-installer attempted to start[*]. The error message was this:&lt;/p&gt;</description>
			</item>
			<item>
				<title>Fixing vagrant-vbguest for the centos/7 base box</title>
				<link>https://www.puppeteers.net/blog/fixing-vagrant-vbguest-for-the-centos-7-base-box/</link>
				<pubDate>Thu, 25 Feb 2021 00:00:00 +0000</pubDate>
				<guid>https://www.puppeteers.net/blog/fixing-vagrant-vbguest-for-the-centos-7-base-box/</guid>
				<description>&lt;p&gt;We&amp;rsquo;re using the centos/7 base box in Vagrant a lot and often hit this problem when bringing up new VMs with Vagrant:&lt;/p&gt;&#xA;&lt;div class=&#34;code-block&#34;&gt;&#xA;    &lt;button class=&#34;code-copy&#34; type=&#34;button&#34; hidden aria-label=&#34;Copy code to clipboard&#34;&gt;&#xA;      &lt;span class=&#34;code-copy-label&#34; aria-hidden=&#34;true&#34;&gt;Copy&lt;/span&gt;&#xA;    &lt;/button&gt;&#xA;    &lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;umount: /mnt: not mounted&lt;/code&gt;&lt;/pre&gt;&#xA;  &lt;/div&gt;&lt;p&gt;This error comes from vagrant-vbguest plugin which tried to install the Virtualbox Guest Additions but failed. The error message is misleading, because the real issue is related to upstream (CentOS) yum repositories. As explained in this &lt;a href=&#34;https://github.com/hashicorp/vagrant/issues/12095&#34;&gt;Vagrant bug report&lt;/a&gt;:&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;&amp;ldquo;Basically the CentOS that you&amp;rsquo;re installing is containing an old kernel version which has been removed from CentOS repositories. Vagrant is trying to install Guest Additions, which has as a dependency the kernel-devel package. kernel-devel package must be the same version as the kernel package that you have it installed in your CentOS box, version which is removed from the CentOS repos.&amp;rdquo;&lt;/em&gt;&lt;/p&gt;</description>
			</item>
			<item>
				<title>Creating PXE bootable Virtualbox VMs</title>
				<link>https://www.puppeteers.net/blog/creating-pxe-bootable-virtualbox-vms/</link>
				<pubDate>Wed, 24 Feb 2021 00:00:00 +0000</pubDate>
				<guid>https://www.puppeteers.net/blog/creating-pxe-bootable-virtualbox-vms/</guid>
				<description>&lt;p&gt;We use &lt;a href=&#34;https://www.vagrantup.com/&#34;&gt;Vagrant&lt;/a&gt; and &lt;a href=&#34;https://www.virtualbox.org/&#34;&gt;Virtualbox&lt;/a&gt; heavily when developing Puppet code. We also do provisioning of baremetal servers with &lt;a href=&#34;https://theforeman.org/&#34;&gt;Foreman&lt;/a&gt;. While Vagrant is a really powerful tool, it is not designed for creating VMs that boot from the network (&lt;a href=&#34;https://en.wikipedia.org/wiki/Preboot_Execution_Environment&#34;&gt;PXE boot&lt;/a&gt;). Fortunately Virtualbox itself provides a rich command-line with which you can create and configure virtual machines and configure them to boot from the network. It is assumed below that there is a PXE boot server (e.g. Foreman) created into a hostonly network with Vagrant. Here&amp;rsquo;s an example script that create a VM with vboxmanage and adds it the same hostonly network interface (vboxnet15) as the PXE boot server:&lt;/p&gt;</description>
			</item>
			<item>
				<title>Vagrant, Powershell ja parametrien välittäminen</title>
				<link>https://www.puppeteers.net/blog/vagrant-powershell-ja-parametrit/</link>
				<pubDate>Mon, 13 Nov 2017 00:00:00 +0000</pubDate>
				<guid>https://www.puppeteers.net/blog/vagrant-powershell-ja-parametrit/</guid>
				<description>&lt;p&gt;Vagrant on näppärä väline myös Windows-virtuaalikoneiden luontiin esim. Puppet-resurssien testauksessa. Windows-virtuaalikoneille on luontevaa käyttää Powershell-provisiointia, minkä Vagrant tekee melkoisen yksinkertaiseksi. Aika nopeasti ilmenee tarve välittää Powershell-skriptille parametrejä Vagrantin kautta. Tästä on hieman hankalaa löytää esimerkkejä, joten tässä yksi.&lt;/p&gt;&#xA;&lt;p&gt;Oletetaan että meillä on Powershell-skripti nimeltä bootstrap_windows.ps1 Vagrant-projektin alihakemistossa &amp;lsquo;provision&amp;rsquo;. Skripti asentaa ja konfiguroi Puppet-agentin Windows-virtuaalikoneelle. Skriptille pitää välittää kaksi parametria: Puppetserverin FQDN (serverName) ja mukavuusbonuksena virtuaalikoneelle haluttu FQDN (certName). (Käytän itse Vagrantille yaml-muotoista ns. data-driven vagrant-tiedostoa, joten syntaksi on hieman erilainen vakiomuotoiseen Vagrant-tiedostoon verrattuna).&lt;/p&gt;</description>
			</item>
	</channel>
</rss>
