Thursday, February 12, 2026

Windows VM notes.

 Despite how much you dislike Windows, especially Windows 11, there are still times which you can't escape from it.  Like many people, I have a virtualbox VM for it, and here are few things I would do to make it "better".

 1) Debloating.  It is not a secret Windows 11 is not lean even with a fresh installed.  Especially if you are unfrotunately having the joy of using its Home edition.  So, the first thing you may want to do is to trim it down.  Win11Debloat may be a good start.

 https://github.com/Raphire/Win11Debloat

 

 

 

 



2) Compact the VDI image. There are times you either just want to keep the VDI file size in control or you want to export the VM as OVA for backup. For both instance, you may want o compact your VDI first. Here are steps I would take.

a) run Windows' Cleaner tool to delete any obsolete/residue files left from Windows updates.

b) run sdelete to "zero" the empty spaces after the deletion in (a)

sdelete c: /z
sdelete is a power toy tool that can be obtained at: https://learn.microsoft.com/en-us/sysinternals/downloads/sdelete

c) run the Windows defrag tool to defragment the drive, so all empty spaces are in continuous blockss.

d) optional. I often run the (b) again, to zero the empty space once more before the compacting.

e) shutdown the VM, and run the below command on the host machine to the VDI file to compact the file.

 vboxmanage modifyhd <your vdi file> --compact 

 If you get the erorr below, try switch to cmd and try again.

  


 

How to get my public IP in Linux with cmd?



There are times when you are on a cmd only set up and you want to know your current public IP. This little command may help you.

curl ifconfig.co

 If you specifically want IPv4 address, you add -4 switch to the command as below.

 curl -4 ifconfig.co

 

Debian 13 Installation notes

Recently, I have started to use Debian instead of Ubuntu for my computers.  There are a lot to like in Ubuntu, the cleaner default install is more favourable for virtual machines.

Here are few notes that I took while I was setting up my Debian.  They are reminders to myself, but they may also be useful to others.

1) Use the Advanced Graphical Install option found under Advanced Options instead.  Most Debian derived distributions disable the root user by default, but Debian does NOT do this with its default option, "Graphical Install".  However, if you use the advanced options, you can choose to disable the root user during the installation time.

 

 

2) Make ext4 more SSD friendly by add mount options: "discard,noatime,nodiratime".  

sudo findmnt --verify --verbose

 Since it is a pain to fix the fstab if a mistake was made.  Use the below to verify your changes!

sudo findmnt --verify --verbose

 

 

3) Reduce swappiness.  By default, Linux can be a bit too aggressive in using your hard drive for virtual memory.  By reducing its aggressiveness can make your system performs better as well as prolonging the life of your hard drive.  This achieves by adding a conf file to /etc/sysctl.d with the content below.  I named mine 99-swappiness.conf.

 vm.swappiness=1

 

 4) Improve system responsiveness during USB drive writing.  It is a bit beyond my capabilities to explain this in details.  If you want to know more, you can try this link, https://forum.manjaro.org/t/the-pernicious-usb-stick-stall-problem/52297 and https://www.reddit.com/r/linux4noobs/comments/1p9h136/copyingmoving_files_to_usb_media_weirdness/

With the default installation, if you are copying a large file to your pen drive, you are likely to end up with a very sluggish if not irresponsive system.  This issue can be mitigated by adding another conf file to /etc/sysctl.d/ with the lines below.  I named mine 99-usb-drive.conf

vm.dirty_ratio = 3
vm.dirty_background_ratio = 3
vm.dirty_expire_centisecs=3000
vm.dirty_writeback_centisecs=1500
vm.min_free_kbytes=59030

 

You can use "sudo sysctl --system" to apply the change without a reboot.

 

Here is what Google AI said about the ratio. 

   

 

4) Add NetBIOS supports.  By default, if you are trying to referencing another machine in your network by its name, you are likely to get an error.  This is because the default set up does not understand NetBIOS.  To make your new install aware other Windows machines in your network better, you need to add the winbind support by:


apt install libnss-winbind winbind

Then, update your /etc/nsswitch to inlcude wins, i.e.



5) Add fonts support to CKJ and Thai characters.

apt install fonts-noto* fonts-thai-tlwg*

6) Add "Open in Terminal" to the context menu.
 sudo apt install caja-open-terminal

 

 

That is it.  I hope you found this useful. 

Sunday, February 2, 2025

OpenWRT and VLAN

I use a NanoPi R2S as my back up router.  Another day, I was setting it up from scratch.  I set up VLANs on it as I did before, however, I couldn't get an IP from any of the newly created VLAN networks.  I have checked the VLAN set up over and over again, and compare it with setups found in YouTube videos.  Everything seems in order.  Then, I check my switch, and again everything seems right too.  I was puzzling for a few days.









Few days later, I looked at the settings again, still couldn't see anything wrong.  Then it dawned on me to check the firewall settings, and the problem was indeed an firewall issue.  I may be wrong, but I think the own default was

input -> accept
output -> accept
forward -> reject

where as the new default is 

input -> reject
output -> accept
forward -> reject

As I highlighted, the culprit for my problem is the change to the input default setting.

INPUT governs traffic originating from devices in the zone that has its final destination on the router. Examples for this would be DHCP requests or DNS lookups

With input set to reject, computers on the network cannot talk to the router, i.e. getting access to the DHCP etc.  Hence, my computer appeared as having problem to join the network.




Simply change the input to accept, the problem fixes.




Friday, October 4, 2024

Move Show Apps button to the left

Being a long time Windows users, one thing that bugs me in GNOME is the location of the "Show Applications" button.  When the dock is set to bottom, it is on the right hand side rather the left.  There is no option in setting sto move this the left bottom corner.

After a bit of research, it seems the command below would fix my problem.

gsettings set org.gnome.shell.extensions.dash-to-dock show-apps-at-top true
At first, I find it odd as it sets the button to the top rather than to the left.  Then, I remember the default layout of the dock is vertical.  The button was on the bottom.  Now setting the button to the "top" makes a lot of sense as when laying the dock horizontally, the left spot is what it was the "top" position when it was vertical.

Now the fix makes the dock perfect.

Sunday, August 11, 2024

Missing firmware

If you have the missing firmware warnings similar to below, you can try this.

update-initramfs: Generating /boot/initrd.img-6.9.7+bpo-amd64
W: Possible missing firmware /lib/firmware/rtl_nic/rtl8126a-2.fw for module r8169
W: Possible missing firmware /lib/firmware/i915/mtl_gsc_1.bin for module i915
W: Possible missing firmware /lib/firmware/i915/dg2_huc_gsc.bin for module i915
W: Possible missing firmware /lib/firmware/i915/mtl_huc_gsc.bin for module i915
W: Possible missing firmware /lib/firmware/i915/mtl_guc_70.bin for module i915

1) Get firmware files from git repository

git clone https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git   --depth=1
or alternative, only required files from 

https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/

2)  copy the files download in (1) to corresponding path, e.g.

rtl8126a-2.fw => /lib/firmware/rtl_nic/

 mtl_gsc_1.bin => /lib/firmware/i915/

3) Run update-initramfs  -u again.  Warnings should be gone this time.