| description | lang | tags |
|---|---|---|
Set up a Debian-based Incus host with cloud-init and use Open vSwitch for container networking. |
en |
linux, netplan.io, openvswitch, incus, cloud-init |
[toc]
A new experimental feature was added by Microsoft that will resolve this issue in the future. You will need to update to Windows Insider Build for Windows 10 or latest Windows 11 and update WSL. More info here.
On WSL1 we can access windows services running on localhost ports directly, but when WSL2 was introduced things started breaking. One of those issue is access to windows localhost ports [^1]
To understand this issue we need to learn what is WSL2:
| # Vagrant With Windows, WSL2 and Hyper-V | |
| To say getting this configuration working is a pain in the ass is an understatement. However, once it is working correctly you gain access to tools like Ansible and full performance VMs inside Windows. This guide covers the steps I followed to get things working correctly with this configuration. It is possible that something may not work for you however I have been able to reproduce this success on two Windows 11 Pro machines and expect this to work for others. | |
| This guide assumes basic knowledge of Windows and Linux systems and how Vagrant operates. Due to the difficulty of setting this up you may need to do some additional troubleshooting | |
| ## Requirements | |
| * Windows Professional - Hyper-V can only be installed on Windows Professional systems or higher | |
| * WSL2 - Due to the massive differences between WSL1 and WSL2 this guide will only cover support for WSL2 | |
| * CPU Virtualization - While the vast majority of modern CPUs support virtualization you may need to enable it in |
| { system ? builtins.currentSystem }: | |
| let | |
| pkgs = import <nixpkgs> { inherit system; }; | |
| callPackage = pkgs.lib.callPackageWith (pkgs // self); | |
| self = with pkgs; { | |
| etlegacy-x86 = callPackage_i686 ./etlegacy-x86.nix { usePrecompiledModLibs = true; }; | |
| etlegacy-x86_64 = callPackage ./etlegacy-x86_64.nix { usePrecompiledModLibs = true; }; | |
| }; | |
| in self.etlegacy-x86 # or self.etlegacy-x86_64 |
| { system ? builtins.currentSystem }: | |
| let | |
| pkgs = import <nixpkgs> { inherit system; }; | |
| callPackage = pkgs.lib.callPackageWith (pkgs // self); | |
| self = with pkgs; { | |
| etlegacy = callPackage_i686 ./etlegacy.nix {}; | |
| }; | |
| in self.etlegacy |
| powershell.exe "$(wslpath -w .)\myscript.ps1" |
| $ gcloud compute instances list - format="csv(name,labels.app-name,labels.biz-unit,labels.env-name,metadata.items.server-role,metadata.items.server-type, metadata.items.os-image)" | |
| name,app-name,biz-unit,env-name,server-role,server-type,os-image | |
| app-server-1,misc,ecom,prod,app,tomcat,centos | |
| web-server-1,misc,ecom,prod,web,nginx,centos | |
| web-server-2,misc,ecom,prod,web,nginx,centos |
| function main { | |
| Update-Windows-Configuration | |
| Install-Utils | |
| Install-Browsers | |
| Install-Fonts |
| #!/bin/bash | |
| # 1. Fill in your module name | |
| # 2. Run the terraform state mv commands from the output | |
| # Pipeline steps: | |
| # Generate plan | |
| # Remove ANSI colour codes | |
| # Generate state mv commands | |
| # Strip any moves of numbered instances of a resource (i.e. from using count) |