<?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>Hyper-V &#8211; Made For Cloud</title>
	<atom:link href="https://madeforcloud.com/category/hyper-v/feed/" rel="self" type="application/rss+xml" />
	<link>https://madeforcloud.com</link>
	<description>Just another WordPress site</description>
	<lastBuildDate>Sun, 30 Jun 2024 04:03:35 +0000</lastBuildDate>
	<language>en-AU</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.3</generator>
	<item>
		<title>Getting WSL2 just right</title>
		<link>https://madeforcloud.com/2024/06/30/getting-wsl2-just-right/</link>
					<comments>https://madeforcloud.com/2024/06/30/getting-wsl2-just-right/#respond</comments>
		
		<dc:creator><![CDATA[gocallag]]></dc:creator>
		<pubDate>Sun, 30 Jun 2024 04:03:35 +0000</pubDate>
				<category><![CDATA[Hyper-V]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[WSL]]></category>
		<guid isPermaLink="false">https://madeforcloud.com/?p=223</guid>

					<description><![CDATA[Recent changes to WSL2 by Microsoft have made using Linux on Windows even more comfortable. I&#8217;ll describe some of the options and their use below. Firstly, do you have WSL2 installed? If not, then this will help https://learn.microsoft.com/en-us/windows/wsl/install-manual#step-1&#8212;enable-the-windows-subsystem-for-linux In order to best use WSL, you of course need to have a distribution installed. Ubuntu is&#8230;<p><a class="more-link" href="https://madeforcloud.com/2024/06/30/getting-wsl2-just-right/" title="Continue reading &#8216;Getting WSL2 just right&#8217;">Continue reading <span class="meta-nav">&#8594;</span></a></p>]]></description>
										<content:encoded><![CDATA[
<p>Recent changes to WSL2 by Microsoft have made using Linux on Windows even more comfortable. I&#8217;ll describe some of the options and their use below.</p>



<p>Firstly, do you have WSL2 installed?  If not, then this will help <a href="https://learn.microsoft.com/en-us/windows/wsl/install-manual#step-1---enable-the-windows-subsystem-for-linux">https://learn.microsoft.com/en-us/windows/wsl/install-manual#step-1&#8212;enable-the-windows-subsystem-for-linux</a></p>



<p>In order to best use WSL, you of course need to have a distribution installed. Ubuntu is one of the easiest and most common to install.</p>



<pre class="wp-block-code"><code>wsl --list --online           #check what distros are available
wsl --install -d Ubuntu-24.04 #latest at the time of writing</code></pre>



<p>Now that you have a distro installed, we have something to configure. There are 2 configuration files that customise the distribution experience under WSL2.  <strong>wsl.conf and .wslconfig</strong></p>



<p><strong>wsl.conf </strong>contains per-distribution settings, whereas<strong> .wslconfig</strong> configures global settings for the WSL2 environment.</p>



<p><strong>wsl.conf</strong> is stored in the /etc directory within the distribution.</p>



<p><strong>.wslconfig</strong> is stored in your %UserProfile% folder.</p>



<h1 class="wp-block-heading">.wslconfig</h1>



<p>The .wslconfig file is in .ini format with the GA features found under section <strong>[wsl2]</strong>. There is also an <strong>[experimental]</strong> section for unreleased options. </p>



<p><strong>Note: </strong>All options may not be available to you as they are Windows OS and WSL version dependent. You can reasonably assume if you are running Windows 11, 22H2 or higher that most of the options described below are available to you. This is not the complete list, just the one&#8217;s I have found to be quite useful</p>



<h2 class="wp-block-heading">GA features that I find useful</h2>



<p>Accessible via the <strong>[wsl2] </strong>section of the .wslconfig file</p>



<figure class="wp-block-table"><table><tbody><tr><td>Key</td><td>Value</td><td>Notes</td></tr><tr><td>memory</td><td>memory size (Mb, Gb)</td><td>Default is 50% of the windows memory. <strong>I find it useful to constrain the memory (in conjunction with the experimental memory release features below)</strong></td></tr><tr><td>processors</td><td>number</td><td>Default is the same as present in windows</td></tr><tr><td>localhostForwarding</td><td>true/false</td><td>Default is true, this allows your WSL2 application to be accessible via localhost:port</td></tr><tr><td>nestedVirtualization</td><td>true/false</td><td>Allow nesting inside WSL2, Windows 11+</td></tr><tr><td>networkingMode</td><td>string, NAT, mirrored</td><td>The default is NAT, mirrored turns on mirrored networking mode. <strong>Mirrored mode is a great addition for many of my use cases.</strong></td></tr><tr><td>firewall</td><td>true / false</td><td>Hyper-V firewall can filter WSL network traffic</td></tr><tr><td>dnsTunneling</td><td>false</td><td>see the experimental section</td></tr><tr><td></td><td></td><td></td></tr></tbody></table><figcaption class="wp-element-caption">Some of the GA features</figcaption></figure>



<h2 class="wp-block-heading">Experimental (though very useful) features</h2>



<p>Accessible via <strong>[experimental]</strong> section of the .wslconfig file.</p>



<figure class="wp-block-table"><table><tbody><tr><td>Key</td><td>Value</td><td>Notes</td></tr><tr><td>autoMemoryReclaim</td><td>disabled</td><td>Default is disabled, but options list gradual and dropcache can dramatically return memory outside wsl2. <strong>I default to gradual.</strong></td></tr><tr><td>sparseVHD</td><td>false</td><td>When set to true new VHD&#8217;s are created as sparse saving considerable disk with all the overprovisioning issues. <strong>By default, i&#8217;m using sparse, but then again i&#8217;ve been using sparse filesystems for many years</strong></td></tr><tr><td>useWindowsDnsCache</td><td>false</td><td>If you have dnsTunneling turned on then this option allows you to use or ignore what windows dns may&#8217;ve cached</td></tr><tr><td>hostAddressLoopback</td><td>false</td><td>if networkingMode is set to mirrored then the loopback 127.0.0.1 address can be used to access the host and the container depending on where the listening resource may be running &#8211; windows or wsl2. <strong>This is a great option if you want better sharing between windows and wsl2 distro. For example, i&#8217;ve had a mongo client on windows and mongo in wsl2 ubuntu</strong>. </td></tr></tbody></table><figcaption class="wp-element-caption">Some of the Experimental features</figcaption></figure>



<h1 class="wp-block-heading">wsl.conf</h1>



<p>As I mentioned above the <strong>/etc/wsl.conf</strong> within the distribution controls some interesting behaviours, especially on distro launch.</p>



<h2 class="wp-block-heading">[boot]</h2>



<pre class="wp-block-code"><code>systemd=true</code></pre>



<p>Solves the problem where you&#8217;re reliant on systemd resources within your WSL2 distro.<strong> I normally have it turned on.</strong></p>



<h2 class="wp-block-heading">[automount]</h2>



<figure class="wp-block-table"><table><tbody><tr><td>Key</td><td>Value</td><td>Notes</td></tr><tr><td>enabled</td><td>true / false</td><td>Allows windows fixed drives to be automatically mounted under /mnt (or where the root key points). <strong>I have this enabled by default</strong></td></tr><tr><td>root</td><td>/mnt</td><td>Where the mounts occur for auto mounted systems</td></tr><tr><td>mountFsTab</td><td>true/false</td><td>Allow the /etc/fstab to be processed at WSL distro boot time. Great to get those SMB/NFS mounts going. <strong>I have this set to true as I use a lot of NFS in my test environment.</strong></td></tr></tbody></table></figure>



<p>Some things to note.</p>



<p>Windows disks are mounted using Drvfs and are by default case sensitive. You can override this behaviour for all or single drives. More information is available at <a href="https://devblogs.microsoft.com/commandline/per-directory-case-sensitivity-and-wsl/">Per-directory case sensitivity and WSL &#8211; Windows Command Line (microsoft.com)</a></p>



<h2 class="wp-block-heading">[network]</h2>



<figure class="wp-block-table"><table><tbody><tr><td>Key</td><td>Value</td><td>Notes</td></tr><tr><td>generateHosts</td><td>true/false</td><td>wsl will generate an appropriate /etc/hosts file based on the windows environment.<strong> I generally set this to true (the default).</strong></td></tr><tr><td>generateResolvConf</td><td>true/false</td><td>wsl will generate an appropriate list of dns resolvers. <strong>I generally set this to true (the default).</strong></td></tr><tr><td>hostname</td><td>string</td><td>This sets the hostname to be used within the distro. <strong>The default is the windows hostname, but this is useful if you run multiple WSL instances.</strong></td></tr></tbody></table></figure>
]]></content:encoded>
					
					<wfw:commentRss>https://madeforcloud.com/2024/06/30/getting-wsl2-just-right/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Milestone 0.1.5 for Hyper-V ansible collection</title>
		<link>https://madeforcloud.com/2024/06/10/milestone-0-1-5-for-hyper-v-ansible-collection/</link>
					<comments>https://madeforcloud.com/2024/06/10/milestone-0-1-5-for-hyper-v-ansible-collection/#respond</comments>
		
		<dc:creator><![CDATA[gocallag]]></dc:creator>
		<pubDate>Mon, 10 Jun 2024 01:53:51 +0000</pubDate>
				<category><![CDATA[Ansible]]></category>
		<category><![CDATA[Hyper-V]]></category>
		<guid isPermaLink="false">https://madeforcloud.com/?p=218</guid>

					<description><![CDATA[Milestone 0.1.5 has been achieved for the gocallag.hyperv collection which you can find in ansible galaxy at Ansible Galaxy &#8211; gocallag.hyperv. Release notes for 0.1.5 can be found over at github at Release Milestone 0.1.5 · gocallag/hyperv (github.com) Further information on upcoming milestones and their associated features can be found at Milestones &#8211; gocallag/hyperv (github.com)&#8230;<p><a class="more-link" href="https://madeforcloud.com/2024/06/10/milestone-0-1-5-for-hyper-v-ansible-collection/" title="Continue reading &#8216;Milestone 0.1.5 for Hyper-V ansible collection&#8217;">Continue reading <span class="meta-nav">&#8594;</span></a></p>]]></description>
										<content:encoded><![CDATA[
<p>Milestone 0.1.5 has been achieved for the gocallag.hyperv collection which you can find in ansible galaxy at <a href="https://galaxy.ansible.com/ui/repo/published/gocallag/hyperv/">Ansible Galaxy &#8211; gocallag.hyperv</a>.</p>



<p>Release notes for 0.1.5 can be found over at github at <a href="https://github.com/gocallag/hyperv/releases/tag/0.1.5">Release Milestone 0.1.5 · gocallag/hyperv (github.com)</a></p>



<p>Further information on upcoming milestones and their associated features can be found at <a href="https://github.com/gocallag/hyperv/milestones">Milestones &#8211; gocallag/hyperv (github.com)</a></p>



<h2 class="wp-block-heading">What&#8217;s Changed</h2>



<ul class="wp-block-list">
<li>Added Feature to vm_info to provide search capability by Name </li>



<li>Closed Issue 2 &#8211; Feature to allow vm info to search by power state and names </li>



<li>BugFIX: Use the convertto-json , convertfrom-json to avoid loop in Exit-Json (limiting depth) </li>



<li>Closed Test Issue: Added verifier for vm_info module checks and cleanups</li>



<li>Closed Test Issue: Added basic asserts for switch_info testing via molecule</li>



<li>Closed Test Issue: Added verifier asserts for switch module as part of molecule testing </li>



<li>Closed Test Issue: Added assert based testing for vm module as part of molecule</li>



<li>BugFIX, Issue 12: bug vm info fails molecule verifier on running vm check </li>
</ul>



<p>Feedback / Requests welcome.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://madeforcloud.com/2024/06/10/milestone-0-1-5-for-hyper-v-ansible-collection/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Ansible Collection for hyperv management</title>
		<link>https://madeforcloud.com/2024/06/01/ansible-collection-for-hyperv-management/</link>
					<comments>https://madeforcloud.com/2024/06/01/ansible-collection-for-hyperv-management/#respond</comments>
		
		<dc:creator><![CDATA[gocallag]]></dc:creator>
		<pubDate>Sat, 01 Jun 2024 00:58:19 +0000</pubDate>
				<category><![CDATA[Ansible]]></category>
		<category><![CDATA[Hyper-V]]></category>
		<guid isPermaLink="false">https://madeforcloud.com/?p=215</guid>

					<description><![CDATA[Just a quick blog post about a small ansible collection i&#8217;m developing to manage my hyperv lab vm&#8217;s. You can find it over at gocallag/hyperv (github.com)]]></description>
										<content:encoded><![CDATA[
<p>Just a quick blog post about a small ansible collection i&#8217;m developing to manage my hyperv lab vm&#8217;s.</p>



<p>You can find it over at <a href="https://github.com/gocallag/hyperv">gocallag/hyperv (github.com)</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://madeforcloud.com/2024/06/01/ansible-collection-for-hyperv-management/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Hyper-V force shutdown VM</title>
		<link>https://madeforcloud.com/2024/05/18/hyper-v-force-shutdown-vm/</link>
					<comments>https://madeforcloud.com/2024/05/18/hyper-v-force-shutdown-vm/#respond</comments>
		
		<dc:creator><![CDATA[gocallag]]></dc:creator>
		<pubDate>Sat, 18 May 2024 05:05:10 +0000</pubDate>
				<category><![CDATA[Hyper-V]]></category>
		<guid isPermaLink="false">https://madeforcloud.com/?p=211</guid>

					<description><![CDATA[Let&#8217;s face it, sometimes a Hyper-V gets stuck in a funny state and you can&#8217;t shut it down from the UI. Fear not, you can easily force it down using powershell. Firstly, get the guid of the VM. Then, find the process that&#8217;s running that VM. Then you can force stop that process. Hey presto,&#8230;<p><a class="more-link" href="https://madeforcloud.com/2024/05/18/hyper-v-force-shutdown-vm/" title="Continue reading &#8216;Hyper-V force shutdown VM&#8217;">Continue reading <span class="meta-nav">&#8594;</span></a></p>]]></description>
										<content:encoded><![CDATA[
<p>Let&#8217;s face it, sometimes a Hyper-V gets stuck in a funny state and you can&#8217;t shut it down from the UI. Fear not, you can easily force it down using powershell.</p>



<p>Firstly, get the guid of the VM.</p>



<pre class="wp-block-code"><code>$VMID = (Get-VM '&lt;name of the VM from the hyper-v manager (or Get-VM)').id</code></pre>



<p>Then, find the process that&#8217;s running that VM.</p>



<pre class="wp-block-code"><code>$VMProcess = (Get-WMIObject Win32_Process | ? {$_.Name -match 'VMWP' -and $_.CommandLine -match $VMID})</code></pre>



<p>Then you can force stop that process.</p>



<pre class="wp-block-code"><code>Stop-Process ($VMProcess.ProcessId) –Force</code></pre>



<p>Hey presto, the VM should be down.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://madeforcloud.com/2024/05/18/hyper-v-force-shutdown-vm/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Hyper-V set display resolution</title>
		<link>https://madeforcloud.com/2024/05/18/hyper-v-set-display-resolution/</link>
					<comments>https://madeforcloud.com/2024/05/18/hyper-v-set-display-resolution/#respond</comments>
		
		<dc:creator><![CDATA[gocallag]]></dc:creator>
		<pubDate>Sat, 18 May 2024 04:54:16 +0000</pubDate>
				<category><![CDATA[Hyper-V]]></category>
		<guid isPermaLink="false">https://madeforcloud.com/?p=209</guid>

					<description><![CDATA[With all the migration from VMware to other sources, Hyper-V is making quite a comeback. Hyper-V is a lot better than the good (aka bad) old days, but you still need to know how to handle certain quirks. In this case I needed to change the resolution of my Hyper-V windows guest to something higher&#8230;<p><a class="more-link" href="https://madeforcloud.com/2024/05/18/hyper-v-set-display-resolution/" title="Continue reading &#8216;Hyper-V set display resolution&#8217;">Continue reading <span class="meta-nav">&#8594;</span></a></p>]]></description>
										<content:encoded><![CDATA[
<p>With all the migration from VMware to other sources, Hyper-V is making quite a comeback. Hyper-V is a lot better than the good (aka bad) old days, but you still need to know how to handle certain quirks.</p>



<p>In this case I needed to change the resolution of my Hyper-V windows guest to something higher as it was stuck on the default 1152&#215;864.</p>



<p>It&#8217;s simple to fix, just shutdown your VM in the Hyper-V manager (or use powershell) and when the system is down, open a powershell window and use.</p>



<pre class="wp-block-code"><code>Set-VMVideo -VMName "&lt;Name of VM in Manager>" -HorizontalResolution 1920 -VerticalResolution 1080 -ResolutionType Single</code></pre>



<p>Then when you power the VM back on and access via the Hyper-V display option you will have a VM with the larger screen resolution.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://madeforcloud.com/2024/05/18/hyper-v-set-display-resolution/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Hyper-V meet RHEL8 &#8211; screen resolution</title>
		<link>https://madeforcloud.com/2019/10/31/hyper-v-meet-rhel8-screen-resolution/</link>
		
		<dc:creator><![CDATA[gocallag]]></dc:creator>
		<pubDate>Wed, 30 Oct 2019 23:44:29 +0000</pubDate>
				<category><![CDATA[Hyper-V]]></category>
		<category><![CDATA[Red Hat]]></category>
		<guid isPermaLink="false">http://madeforcloud.com/?p=23</guid>

					<description><![CDATA[I&#8217;m running Hyper-V on my laptop and I&#8217;m also doing work with RHEL 8 desktops. Alas, the default screen resolution you get is the rather odd 1152&#215;864. In order to make this more reasonable, such as the 1920&#215;1080 full screen resolution on my laptop you have to set the hyper-v framebuffer at boot time. You&#8217;ll&#8230;<p><a class="more-link" href="https://madeforcloud.com/2019/10/31/hyper-v-meet-rhel8-screen-resolution/" title="Continue reading &#8216;Hyper-V meet RHEL8 &#8211; screen resolution&#8217;">Continue reading <span class="meta-nav">&#8594;</span></a></p>]]></description>
										<content:encoded><![CDATA[
<p>I&#8217;m running Hyper-V on my laptop and I&#8217;m also doing work with RHEL 8 desktops.  Alas,  the default screen resolution you get is the rather odd 1152&#215;864.</p>



<p>In order to make this more reasonable, such as the 1920&#215;1080 full screen resolution on my laptop you have to set the hyper-v framebuffer at boot time.</p>



<pre class="wp-block-code"><code>sudo grubby --update-kernel=ALL --args="video=hyperv_fb:1920x1080"</code></pre>



<p>You&#8217;ll likely need to do this after each kernel update.  </p>



<p>May the full screen be with you.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
