You’ve probably tried to build a bootable USB drive and it hasn’t copied the image correctly.
I highly recommend using rufus in DD mode. This has always worked for me.
You’ve probably tried to build a bootable USB drive and it hasn’t copied the image correctly.
I highly recommend using rufus in DD mode. This has always worked for me.
Install the required packages
You will need to install the cifs-utils package to mount a network drive on an Ubuntu Linux system.
sudo apt-get install -y cifs-utils
For a Red Hat based system you will also need the cifs-utils package, installed by dnf
sudo dnf install -y cifs-utils
Create a mount point
Create a mount point for the CIFS share. eg.
sudo mkdir /srv/cifs/<share> # where '<share>' is the name of the share you want mounted
Create a credentials file
sudo vim /etc/credentials.<share> # where '<share>' is the name of the share you want mounted
Add the following contents to the credentials file, updating with your userid/password details to access your share.
username=<shareuser>
password=<sharepassword>
Make sure the credentials file is only visible to root
sudo chown root:root /etc/credentials.<share> # where '<share>' is the name of the share you want mounted
sudo chmod 600 /etc/credentials.<share>
Add the mount to /etc/fstab
To mount the network drive permanently, you need to add an entry to the /etc/fstab file to ensure the share is mounted automatically when the system boots.
Open the /etc/fstab file in a text editor and add the following line:
//<ip address of your cifs server>/<share> /srv/cifs/<share> cifs credentials=/etc/credentials.<share> 0 0
Testing the mount
sudo mount -a
df -h
This should show the CIFS share mounted at the specified mount point.
When PR https://github.com/oVirt/ovirt-node-ng-image/pull/146 lands you will be able to build oVirt nodes using AlmaLinux 9 (new) and Centos 9 Stream (fixed).
There are still a few issues with AlmaLinux 9, not because of AlmaLinux, but because the oVirt engine force enables a bunch of Centos 9 Stream repositories breaking the system. You can get around this by basically disabling those repositories in /etc/yum.repos.d/ as they appear – bugs will be filed with the engine.
Step 1. Add the signing key
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
Step 2. Add the repository
echo -e "[vscode]\nname=packages.microsoft.com\nbaseurl=https://packages.microsoft.com/yumrepos/vscode/\nenabled=1\ngpgcheck=1\nrepo_gpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc\nmetadata_expire=1h" | sudo tee -a /etc/yum.repos.d/vscode.repo
Step 3. Refresh the yum meta data
sudo dnf update -y
Step 4. Install vscode
sudo dnf install code -y
Step 1. Import the key
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
Step 2. Add the repos
sudo dnf config-manager --add-repo https://packages.microsoft.com/yumrepos/edge
Step 3. Refresh the yum meta data
sudo dnf update --refresh
Step 4. Install Edge
sudo dnf install microsoft-edge-stable
Microsoft Edge should now be available for you to use either via the CLI or the Gnome Deskop
Like many people I am an extensive user of WSL and Linux under Windows in general. It’s the only real option I have at work and it’s quite a reasonable proposition.
That being said though, the WSL vhdx files can grow as you’re doing Linux work and while you can (and should) clean up side the Linux environment it’s not reflected back to windows as free space.
So how do you compact your WSL file?
wsl.exe --list --verbose # note the verbose is required to get the state
wsl.exe --terminate Ubuntu-24.04
diskpart
select vdisk file="C:\Users\geoff\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu24.04LTS_79rhkp1fndgsc\LocalState\ext4.vhdx"
compact vdisk
Recent changes to WSL2 by Microsoft have made using Linux on Windows even more comfortable. I’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—enable-the-windows-subsystem-for-linux
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.
wsl --list --online #check what distros are available
wsl --install -d Ubuntu-24.04 #latest at the time of writing
Now that you have a distro installed, we have something to configure. There are 2 configuration files that customise the distribution experience under WSL2. wsl.conf and .wslconfig
wsl.conf contains per-distribution settings, whereas .wslconfig configures global settings for the WSL2 environment.
wsl.conf is stored in the /etc directory within the distribution.
.wslconfig is stored in your %UserProfile% folder.
The .wslconfig file is in .ini format with the GA features found under section [wsl2]. There is also an [experimental] section for unreleased options.
Note: 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’s I have found to be quite useful
Accessible via the [wsl2] section of the .wslconfig file
Key | Value | Notes |
memory | memory size (Mb, Gb) | Default is 50% of the windows memory. I find it useful to constrain the memory (in conjunction with the experimental memory release features below) |
processors | number | Default is the same as present in windows |
localhostForwarding | true/false | Default is true, this allows your WSL2 application to be accessible via localhost:port |
nestedVirtualization | true/false | Allow nesting inside WSL2, Windows 11+ |
networkingMode | string, NAT, mirrored | The default is NAT, mirrored turns on mirrored networking mode. Mirrored mode is a great addition for many of my use cases. |
firewall | true / false | Hyper-V firewall can filter WSL network traffic |
dnsTunneling | false | see the experimental section |
Accessible via [experimental] section of the .wslconfig file.
Key | Value | Notes |
autoMemoryReclaim | disabled | Default is disabled, but options list gradual and dropcache can dramatically return memory outside wsl2. I default to gradual. |
sparseVHD | false | When set to true new VHD’s are created as sparse saving considerable disk with all the overprovisioning issues. By default, i’m using sparse, but then again i’ve been using sparse filesystems for many years |
useWindowsDnsCache | false | If you have dnsTunneling turned on then this option allows you to use or ignore what windows dns may’ve cached |
hostAddressLoopback | false | 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 – windows or wsl2. This is a great option if you want better sharing between windows and wsl2 distro. For example, i’ve had a mongo client on windows and mongo in wsl2 ubuntu. |
As I mentioned above the /etc/wsl.conf within the distribution controls some interesting behaviours, especially on distro launch.
systemd=true
Solves the problem where you’re reliant on systemd resources within your WSL2 distro. I normally have it turned on.
Key | Value | Notes |
enabled | true / false | Allows windows fixed drives to be automatically mounted under /mnt (or where the root key points). I have this enabled by default |
root | /mnt | Where the mounts occur for auto mounted systems |
mountFsTab | true/false | Allow the /etc/fstab to be processed at WSL distro boot time. Great to get those SMB/NFS mounts going. I have this set to true as I use a lot of NFS in my test environment. |
Some things to note.
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 Per-directory case sensitivity and WSL – Windows Command Line (microsoft.com)
Key | Value | Notes |
generateHosts | true/false | wsl will generate an appropriate /etc/hosts file based on the windows environment. I generally set this to true (the default). |
generateResolvConf | true/false | wsl will generate an appropriate list of dns resolvers. I generally set this to true (the default). |
hostname | string | This sets the hostname to be used within the distro. The default is the windows hostname, but this is useful if you run multiple WSL instances. |
Milestone 0.1.5 has been achieved for the gocallag.hyperv collection which you can find in ansible galaxy at Ansible Galaxy – 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 – gocallag/hyperv (github.com)
Feedback / Requests welcome.
Just a quick blog post about a small ansible collection i’m developing to manage my hyperv lab vm’s.
You can find it over at gocallag/hyperv (github.com)
Let’s face it, sometimes a Hyper-V gets stuck in a funny state and you can’t shut it down from the UI. Fear not, you can easily force it down using powershell.
Firstly, get the guid of the VM.
$VMID = (Get-VM '<name of the VM from the hyper-v manager (or Get-VM)').id
Then, find the process that’s running that VM.
$VMProcess = (Get-WMIObject Win32_Process | ? {$_.Name -match 'VMWP' -and $_.CommandLine -match $VMID})
Then you can force stop that process.
Stop-Process ($VMProcess.ProcessId) –Force
Hey presto, the VM should be down.