An awesome blog about software development and network security.

This document aims to help users adapt their Mac keyboard habits to be more like Windows by using Karabiner-Elements.

Basic Settings

1. Install Karabiner-Elements

First, you need to download and install Karabiner-Elements from the official website: https://karabiner-elements.pqrs.org/.

2. Simple Modifications

With the “Simple Modifications” feature in Karabiner-Elements, you can easily map keys. For example, you can set the following mappings:

  • left_command to left_option
  • left_control to left_command
  • left_option to left_control

This helps to make the Mac keyboard behavior more consistent with Windows habits.

Advanced Custom Rules (Complex Modifications)

Beyond simple modifications, Karabiner-Elements also supports “Complex Modifications”. In the Karabiner-Elements application, navigate to the “Complex Modifications” tab and click Add your own rule to add custom rules.

Below are some common custom rule JSON codes that you can paste into the new rule editor.

1. Use the Left Shift Key to Switch Input Methods

This rule allows you to switch input methods with a short press of the left Shift key, while a long press retains its original function.

*Source: https://idawnlight.com/2022/use-left-shift-to-switch-input-sources-on-macos/

{
    "description": "Use left_shift to switch input sources",
    "manipulators": [
        {
            "conditions": [
                {
                    "bundle_identifiers": [
                        "^com\.teamviewer\.TeamViewer$",
                        "^com\.vmware\.horizon$",
                        "^com\.vmware\.fusion$",
                        "^com\.vmware\.view$",
                        "^com\.parallels\.desktop$",
                        "^com\.parallels\.vm$",
                        "^com\.parallels\.desktop\.console$",
                        "^org\.virtualbox\.app\.VirtualBoxVM$",
                        "^com\.citrix\.XenAppViewer$",
                        "^com\.vmware\.proxyApp\.",
                        "^com\.parallels\.winapp\."
                    ],
                    "type": "frontmost_application_unless"
                }
            ],
            "from": {
                "key_code": "left_shift",
                "modifiers": { "optional": ["caps_lock"] }
            },
            "parameters": {
                "basic.to_if_alone_timeout_milliseconds": 200,
                "basic.to_if_held_down_threshold_milliseconds": 200
            },
            "to": [
                {
                    "key_code": "left_shift",
                    "lazy": true
                }
            ],
            "to_if_alone": [
                {
                    "key_code": "spacebar",
                    "modifiers": "control"
                }
            ],
            "to_if_held_down": [{ "key_code": "left_shift" }],
            "type": "basic"
        }
    ]
}

2. Make the Stop Key Actually Stop Music

This rule maps the “Stop” key on the keyboard (usually in the F-key row) to execute the stop command in the “Music” application.

{
    "description": "Make Stop Key actually STOP Music",
    "manipulators": [
        {
            "from": {
                "consumer_key_code": "stop",
                "modifiers": { "optional": ["any"] }
            },
            "to": [{ "shell_command": "/usr/bin/osascript -e 'tell application \"Music\" to stop'" }],
            "type": "basic"
        }
    ]
}

3. Map the Calculator Key to Open the Calculator App

This rule maps the calculator shortcut key on the keyboard (if available) to open the built-in calculator application on macOS.

{
    "description": "Map Fn+F8 (Calculator Key) to Open Calculator App",
    "manipulators": [
        {
            "from": { "consumer_key_code": "al_calculator" },
            "to": [{ "shell_command": "open -a 'Calculator.app'" }],
            "type": "basic"
        }
    ]
}
Read More

Introduction

If you’re encountering errors like “This host does not support AMD-V” or “Intel VT-x is unavailable” when using VMware Workstation, VirtualBox, or other virtualization software, you likely need to disable Windows 11’s VBS (Virtualization-Based Security).

Critical Update: On some Windows 11 24H2 systems, disabling VBS can be more complex. Based on personal testing, traditional methods were not sufficient unless I also disabled the Windows Hello-related registry switch described in Step 5.3.


What is VBS and Why Does It Interfere with Virtual Machines?

VBS (Virtualization-Based Security) is a Windows 11 security feature that creates an isolated security environment using the Hyper-V virtualization layer (Microsoft, 2025c, “Virtualization-based security (VBS)”). While this sounds beneficial, there’s a problem:

  • VBS uses the Hyper-V virtualization layer, which changes how hardware virtualization features (AMD-V or Intel VT-x) are exposed
  • Third-party virtualization software like VMware typically needs direct access to these hardware features
  • When VBS/Hyper-V is running, VMware may be forced into a compatibility mode (WHP), or it may fail to start depending on configuration

In simple terms: VBS can block or limit VMware’s access to hardware virtualization unless you use a supported compatibility mode.


The 24H2 Change: Windows Hello and VBS (Observed Behavior)

Starting with Windows 11 24H2, I observed that Windows Hello-related components can keep VBS enabled on my system. This is based on personal testing and is not an official Microsoft statement.

Note (personal testing, not an official statement): On my 24H2 system, even after disabling VBS using traditional methods, VBS would re-enable after reboot unless I also disabled the Windows Hello-related registry switch described in Step 5.3. Your results may vary depending on device, edition, and policy settings.

This is why some users found that (Cumar, 2024, “VBS is not disabled on Windows 11, version 24H2, OS Build 26100.2161”):

  • Turned off Memory Integrity ✅
  • Ran bcdedit commands ✅
  • Modified registry settings ✅
  • After reboot, VBS still shows “Running”

Complete Disabling Steps (For 24H2)

Prerequisites

  • Windows 11 (any edition: Home/Pro/Enterprise)
  • Administrator privileges
  • Virtualization enabled in BIOS (AMD-V or Intel VT-x)

Step 1: Check Current VBS Status

  1. Press Win + R, type msinfo32, press Enter (Microsoft, 2025a, “Configure Credential Guard”)
  2. In the System Information window, scroll down
  3. Find the “Virtualization-based security” row
    • If it shows “Running” → needs to be disabled
    • If it shows “Not enabled” → no action needed

Step 2: Disable Tamper Protection

  1. Open Settings (Win + I)
  2. Go to Privacy & securityWindows Security
  3. Click Virus & threat protection
  4. Click Manage settings
  5. Toggle Tamper Protection to Off

Step 3: Disable Memory Integrity

  1. Open Settings (Win + I)
  2. Go to Privacy & securityWindows Security
  3. Click Device security
  4. Click Core isolation details
  5. Toggle Memory integrity to Off

If you want VMware to run in WHP compatibility mode (with VBS/Hyper-V enabled), do not disable HypervisorPlatform and VirtualMachinePlatform (Zongmin, 2020, “VMware Workstation 15.5 now supports Host Hyper-V mode”).
The commands below are for fully disabling Hyper-V/VBS to maximize performance.

Open Command Prompt as administrator (search for cmd, right-click and select Run as administrator), then run these commands sequentially:

bcdedit /set hypervisorlaunchtype off
dism /online /Disable-Feature /FeatureName:Microsoft-Hyper-V-All /NoRestart
dism /online /Disable-Feature /FeatureName:HypervisorPlatform /NoRestart
dism /online /Disable-Feature /FeatureName:VirtualMachinePlatform /NoRestart

Policy note: If VBS or Credential Guard is enforced via Group Policy or MDM, local registry toggles may be overridden. In that case, disable it in policy (DeviceGuard/VirtualizationBasedSecurity) first (Microsoft, 2025b, “Policy CSP - DeviceGuard”).


Step 5: Modify Registry (Critical!)

⚠️ This step was crucial in my 24H2 testing

5.1 Disable VBS Main Switch

  1. Press Win + R, type regedit, press Enter
  2. Navigate to:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\DeviceGuard
  3. Find or create EnableVirtualizationBasedSecurity (DWORD 32-bit value)
  4. Double-click and set the value to 0

5.2 Disable Credential Guard (if exists)

Continue in the registry and navigate to:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\DeviceGuard\Scenarios\CredentialGuard

If an Enabled key exists, set its value to 0

5.3 🔥 Disable Windows Hello VBS Dependency (personal testing)

This step is based on personal testing and is not an official Microsoft requirement.

Navigate to:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\DeviceGuard\Scenarios\WindowsHello

Find Enabled (DWORD 32-bit value) and set its value to 0

Important Notes (personal testing):

  • On my system, Windows Hello (including PIN login) still worked after this change
  • Windows Hello no longer used VBS as its security backend (based on observed VBS state)
  • Your experience may differ, especially in managed/enterprise environments or Hello for Business setups

Step 6: Restart Your Computer

Close Registry Editor and restart your computer.


Step 7: Verify Results

After reboot:

  1. Press Win + R, type msinfo32, press Enter
  2. Check if “Virtualization-based security” shows “Not enabled”
  3. Open VMware Workstation and try starting a virtual machine
  4. The “AMD-V/VT-x not supported” error should typically no longer appear

FAQ

Q1: Why does VBS automatically re-enable after reboot?

A: (Personal testing) Most likely because the Windows Hello registry switch was still enabled. On my 24H2 system, disabling it stopped VBS from re-enabling after reboot:

HKEY_LOCAL_MACHINE\...\DeviceGuard\Scenarios\WindowsHello\Enabled = 0

Q2: Can I still use Windows Hello and PIN login after disabling?

A: (Personal testing) Yes on my system. But it may vary by device, Windows edition, and enterprise policies (Hello for Business). Treat it as a best-effort outcome, not a guarantee.

Q3: Do I need to disable virtualization in BIOS?

A: No! Absolutely not! Disabling virtualization in BIOS will make VMware completely unable to run. The correct approach is:

  • Enable virtualization in BIOS (AMD-V or Intel VT-x)
  • Disable VBS and Hyper-V in Windows

Q4: What are the security risks of disabling VBS?

A: VBS provides an additional security protection layer. After disabling:

  • Some advanced security features will be disabled (like Credential Guard)
  • Malware protection capabilities will be slightly reduced
  • The real-world impact varies by usage, threat model, and environment

If your computer is primarily used for development, virtualization testing, etc., the performance gains from disabling VBS may outweigh the security loss depending on your threat model.

Q5: What about games (like VALORANT) that require VBS?

A: Some games’ anti-cheat systems (like Riot Vanguard) do rely on VBS. You need to choose between:

  • Enable VBS → Can play these games, but VMware may need WHP compatibility mode and could be limited
  • Disable VBS → VMware works with full performance, but these games may not run

There’s no perfect solution unless you use dual-boot.

Q6: I have Windows 11 Home, which doesn’t have Group Policy Editor. What should I do?

A: No problem. This tutorial’s methods are entirely based on command line and registry - no Group Policy Editor needed. Home edition works fine.


Compatibility Note: VMware with Hyper-V/VBS Enabled

If you prefer to keep VBS/Hyper-V on, VMware Workstation can still run using Windows Hypervisor Platform (WHP) compatibility mode. This typically has performance or feature limitations compared to direct hardware virtualization (Zongmin, 2020, “VMware Workstation 15.5 now supports Host Hyper-V mode”). The steps in this article focus on maximizing VMware performance by fully disabling VBS/Hyper-V instead of using WHP.


Registry Modification Summary (Quick Reference)

If you want to directly see the registry locations that need modification, here’s the complete list:

Registry Path Key Name Value Description
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\DeviceGuard EnableVirtualizationBasedSecurity 0 Disable VBS main switch
HKEY_LOCAL_MACHINE\...\DeviceGuard\Scenarios\CredentialGuard Enabled 0 Disable Credential Guard
HKEY_LOCAL_MACHINE\...\DeviceGuard\Scenarios\WindowsHello Enabled 0 Windows Hello VBS switch (observed on my system, not official)

All value types are DWORD (32-bit) Value.


Understanding the 24H2 Documentation Gap

The Windows Hello-related VBS behavior I observed on 24H2 may represent an undocumented change or a device/policy-specific interaction. The specific registry setting (DeviceGuard\Scenarios\WindowsHello) is not prominently mentioned in mainstream documentation, which can confuse users following traditional VBS disabling methods (Microsoft, 2025c, “Virtualization-based security (VBS)”; Cumar, 2024, “VBS is not disabled on Windows 11, version 24H2, OS Build 26100.2161”).

Community forums and discussions (such as Microsoft Q&A) have been helpful in identifying possible workarounds. This tutorial consolidates those findings and personal testing to provide a more complete path for systems where VBS re-enables after reboot (Cumar, 2024, “VBS is not disabled on Windows 11, version 24H2, OS Build 26100.2161”).


Conclusion

The VBS disabling process in Windows 11 24H2 is more complex than before, but with the correct steps, it can usually be disabled (Cumar, 2024, “VBS is not disabled on Windows 11, version 24H2, OS Build 26100.2161”).

Key Points Summary:

  1. BIOS virtualization must remain enabled
  2. Windows VBS should be disabled for maximum VMware performance ❌
  3. You may need to disable the Windows Hello VBS switch (personal testing) ❌
  4. Verify results after reboot

If you have any questions, feel free to discuss in the comments. Happy virtualizing!


References:

Read More

Close the VM.
Edit the .vmx file and add this config:

mouse.vusb.enable = "TRUE"
mouse.vusb.useBasicMouse = "FALSE"
usb.generic.allowHID = "TRUE"

Save the .vmx file.
Start the VM and you can see that you can use the mouse side buttons to move forward and backward on the web page.

Read More

Widgets are a new feature introduced by Microsoft in Windows 11.
Currently, the news and interest modules that are enabled by default in widgets provide various kinds of information.

winget uninstall MicrosoftWindows.Client.WebExperience_cw5n1h2txyewy

This removes the Widgets experience. It may reduce background resource usage, but performance impact varies by device and workload.

Read More

Personal note editing needs

Core requirements:

  • Edit and save content in markdown format, which makes the format simple, easy to use, open, and easy to migrate
  • Support WYSIWYG mode when editing, similar to Typora
  • Open source, thus keeping content safe and free
  • Support offline use, data can be stored locally, or stored in third-party channels such as Google Drive, Github repository
  • Support direct copying of pictures and text on web pages and paste them directly
  • Open the folder and display the file directory structure, which is convenient for placing and organizing notes according to the file directory from the sidebar
  • Supports the creation of internal links between markdown files, which can be easily jumped
  • Supports relationship graphs showing internal links in documents

Optional Requirements

  • Supports loading plugins to extend functionality
  • Open the online version editor directly from the web browser, call the file API to open the local folder for editing, therefore even chromebook can use it

Software solutions

Note: The evaluations below reflect my personal testing and observations as of 2022-10-15. Product features and maintenance status may have changed since then.

  • Logseq : Not perfect, but currently the most recommended
  • Advantages:
    • Open source, most functions are as easy to use as Obsidian, such as beautiful appearance, local data storage, support for bidirectional links and relationship graphs
    • There is a web version, you can directly open the local folder
  • Shortcomings:
    • The directory structure browsing is not supported, and all the notes are mixed together and it is not easy to classify. Solution: If you find a way to write a “navigation document”, similar to the Yellow Pages, and then bookmark it, and add a link to the Yellow Pages every time you add a sub-document, it may also be a convenient way to find files by category. This is still not convenient like a directory, but it can be adapted.
    • At the time, the md standard checkbox rendering was not supported.
  • Notion: It is basically free and easy to use, but at the time there was no offline mode that met my needs, and local storage/own-sync workflows were not supported. That introduces privacy concerns for my use case. However, it supports real-time collaboration and can be used on projects, but is not suitable for storing personal core data.
  • Obsidian: It is completely free, easy to use, and supports all requirements except open source, but it is not open source. There is currently no better option for personal use.
  • VSCode+Office Viewer plugin (based on vditor): open source, md editing function is very powerful, and there is a toolbar. But bidirectional links and relational graphs are not supported. It can be said to be a good md editor, but not a very good note editor. And this plugin does not support running in the VSCode web.
Read More

Today I wanted to practice on LeetCode, and then I opened https://github.com/phodal/2md to save the problem to local.
Because I found that there were some small problems with this tool, I forked a copy and fixed some errors that it would generate when converting the content of the LeetCode problem.
In this way, copy the problem of LeetCode and paste it into my 2md, and then copy the converted markdown to save it locally.
Repo: https://github.com/immortalt/2md
The displayed format is correct, and the effect is much better.
The online address of my 2md: https://immortal-blog.github.io/tomd/

Read More

Sometimes the shared folder function of VMware Workstation may suddenly not work after rebooting.
There are several ways to fix it.

mount by a command

sudo vmhgfs-fuse .host:/ /mnt/hgfs -o subtype=vmhgfs,allow_other -o nonempty

This command means to mount all host shared folders to /mnt/hgfs, which is the default operation that VMware should have done automatically.
However, the folder would disappear after rebooting.

mount automatically

sudo nano /etc/fstab

We can edit the fstab file to write the auto-mount configuration. Make sure the mount point exists:

sudo mkdir -p /mnt/hgfs

Then add one line:

.host:/ /mnt/hgfs fuse.vmhgfs-fuse allow_other,defaults 0 0
Read More

When dividing, be careful with large numbers

Sample: they should be different, but due to the float format, they become the same.

a = (1 - 500000000) / (1 - 499999999)
b = (500000000 - 1000000000) / (499999999 - 999999998)
print(a, b, a == b)
# 1.000000002 1.000000002 True

In this situation, we can just simply use Decimal.

from decimal import Decimal
a = Decimal(1 - 500000000) / Decimal(1 - 499999999)
b = Decimal(500000000 - 1000000000) / Decimal(499999999 - 999999998)
print(a, b, a == b)
# 1.000000002000000008000000032 1.000000002000000004000000008 False
Read More

Currently (2022-05-16), VMware Workstation 16.2.3 installs on Ubuntu Desktop 22.04 LTS, but the kernel modules fail to build, so it won’t run.
You can install it and see the icon, but when you try to open it, it will ask you to install some modules and then fail.

Solution

Here is a script that I verified can solve the problem.

git clone https://github.com/mkubecek/vmware-host-modules
cd vmware-host-modules
git checkout workstation-16.2.3
sudo make ; sudo make install
sudo modprobe -a vmw_vmci vmmon vmnet

Then you may need to reboot the host system to make VM networks working.

Conclusion

Although Ubuntu 22.04 is a LTS version, I ran into compatibility issues around this time. My short-term advice then was to use Ubuntu 20.04.

Read More

What are font ligatures?

image
It’s an interesting feature in fonts like JetBrains Mono.

I have enabled JetBrains Mono, but why not see font ligatures?

I think VSCode or Word disables this feature by default, and we need to change font options to enable this feature.

VS Code

Open “Menu”-“Setting”, open “setting.json”, and change this option:

"editor.fontLigatures": true
Read More
⬆︎TOP