{"id":915,"date":"2026-10-23T22:46:03","date_gmt":"2026-10-23T22:46:03","guid":{"rendered":"https:\/\/windows-vps.org\/blog\/?p=915"},"modified":"2026-10-23T22:46:03","modified_gmt":"2026-10-23T22:46:03","slug":"wsl2-windows-server-host-hardware-budget","status":"publish","type":"post","link":"https:\/\/windows-vps.org\/blog\/wsl2-windows-server-host-hardware-budget\/","title":{"rendered":"WSL2 on the Same VPS as IIS and SQL Server: RAM, vCPU, and Disk Math"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">A <code>wsl --install -d Ubuntu-22.04<\/code> on a Windows Server 2022 guest with 8 GB RAM leaves <code>vmmem<\/code> holding 4.1 GB within twenty minutes, because WSL2 runs a real Linux kernel inside a utility VM and the VM&#8217;s memory is not returned to the host on an aggressive schedule. On a dedicated workstation that is invisible. On a VPS that also runs IIS, it is the difference between a healthy server and one that starts swapping at 3 p.m.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Before sizing a host that runs both, you need to know what the WSL2 subsystem actually reserves and how to cap it, because the defaults assume a desktop with tens of gigabytes and no other workloads.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What vmmem Actually Holds<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The WSL2 utility VM boots a Microsoft-built kernel and a minimal userland. At idle with one distribution installed and no processes running, expect <code>vmmem<\/code> to report 800 MB to 1.2 GB in Task Manager. That figure is not the amount of memory your Linux processes are using \u2014 it is what the utility VM has been granted and has touched, including page cache. Launch a build that touches 20,000 files and the cache grows; Linux deliberately fills free memory with cache, and the utility VM does not hand it back promptly.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">From inside the distribution, <code>free -m<\/code> tells you the truth about what Linux thinks it has. From the Windows side, the number that matters is the working set of <code>vmmem<\/code> and, more importantly, the total commit charge: <code>Get-Counter '\\Memory\\Committed Bytes','\\Memory\\Available MBytes'<\/code>. If Available MBytes stays below 15% of installed RAM with no SQL or IIS load, the host is over-subscribed before you have added a workload.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Dynamic Memory and Why the Balloon Misbehaves<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Hyper-V dynamic memory and WSL2&#8217;s own memory reclaim are two separate systems that do not negotiate. WSL2 defines its own ceiling in <code>%UserProfile%\\.wslconfig<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>[wsl2]\nmemory=4GB\nprocessors=2\nswap=2GB\nswapFile=D:\\\\wsl\\\\swap.vhdx\nlocalhostForwarding=true<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Without a <code>memory=<\/code> line, WSL2 on Windows Server defaults to 50% of total RAM, or 8 GB, whichever is lower on older builds. On a 16 GB VPS that means an 8 GB ceiling \u2014 half your memory allocated to a subsystem that is probably running a CLI tool. Set <code>memory=<\/code> explicitly and set <code>processors=<\/code> explicitly, because the default lets Linux see every logical processor on the host, which makes its scheduler and <code>make -j<\/code> behave as though the machine were idle.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Inside a Hyper-V VPS with dynamic memory enabled on the host, the balloon driver can reclaim memory from the Windows guest while <code>vmmem<\/code> inside it believes it owns its allocation. The result is guest-level pressure that Windows resolves by trimming working sets, which pushes WSL2&#8217;s own pages to the guest page file and turns a 2-second command into a 40-second one. Check for it with <code>Get-Counter '\\Memory\\Pages Input\/sec' -SampleInterval 2<\/code>; sustained values above 100 during light WSL use indicate balloon pressure, not a Linux problem.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Nested Virtualization: The Hard Requirement<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">WSL2 is a hypervisor, so it needs hardware virtualization exposed to the guest. On a KVM-based VPS this requires the host to pass through <code>vmx<\/code> or <code>svm<\/code>, which most providers disable by default because it enables guest-escapes-hypervisor attacks. Verify before you buy:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Get-CimInstance Win32_Processor | Select VirtualizationFirmwareEnabled,VMMonitorModeExtensions\nsysteminfo | Select-String \"Hyper-V Requirements\" -Context 0,4<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><code>VMMonitorModeExtensions<\/code> must read <code>True<\/code>. If it reads <code>False<\/code> or the systeminfo block shows &#8220;A hypervisor has been detected&#8221;, WSL2 will fail at boot with <code>WslRegisterDistribution failed with error: 0x80370102<\/code> and you need the provider to enable nested virtualization on the host \u2014 it cannot be fixed from inside the guest. Confirm the feature is offered on the <a href=\"https:\/\/windows-vps.org\/\">Windows VPS configuration guide<\/a> before ordering, because it is not universal.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Disk Cost Is Larger Than the Image Size<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The ext4 filesystem lives inside <code>ext4.vhdx<\/code>, which grows but does not shrink automatically. A 2 GB distribution becomes a 30 GB file after a few months of <code>node_modules<\/code> and container layers, and deleting files inside Linux does not return space to Windows. Two operations are needed: trim from inside, then compact from outside.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Inside the distribution, confirm the discard option is active with <code>mount | grep ext4<\/code> \u2014 the utility VM mounts with <code>discard<\/code> by default on recent builds. Then on Windows, after <code>wsl --shutdown<\/code>, run <code>Optimize-VHD -Path D:\\wsl\\ext4.vhdx -Mode Full<\/code> (requires the Hyper-V PowerShell module) or use <code>diskpart<\/code> with <code>compact vdisk<\/code>. Budget 25-40 GB of data volume for a working WSL2 install and set <code>swapFile=<\/code> onto that same volume rather than the system disk.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Sizing a Host That Also Runs IIS or SQL Server<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Add the numbers up before choosing a plan. IIS with a typical ASP.NET Core application needs 1-1.5 GB for two worker processes plus 0.5 GB of headroom for the OS. SQL Server needs its buffer pool plus a minimum of 1 GB overhead, and Microsoft&#8217;s guidance is to leave 4 GB to the OS on a dedicated database server. WSL2 with a capped 4 GB and a 2 GB swap file adds 4 GB of commit charge and up to 6 GB of disk.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Component<\/th><th>RAM floor<\/th><th>Notes<\/th><\/tr><\/thead><tbody><tr><td>Windows Server 2022 base<\/td><td>1.5 GB<\/td><td>Higher after patch installation<\/td><\/tr><tr><td>IIS + ASP.NET Core<\/td><td>1.5 GB<\/td><td>Two app pool workers under load<\/td><\/tr><tr><td>SQL Server buffer pool<\/td><td>4 GB<\/td><td>Plus 1 GB overhead<\/td><\/tr><tr><td>WSL2 capped<\/td><td>4 GB<\/td><td>Set <code>memory=4GB<\/code> in .wslconfig<\/td><\/tr><tr><td>Headroom for balloon<\/td><td>2 GB<\/td><td>Never plan to use the last 10%<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">That table lands at 14 GB before headroom, which means a 16 GB VPS is the practical minimum and 24 GB is comfortable when SQL Server handles real traffic. Two vCPUs will be contended during <code>dotnet build<\/code> inside WSL while IIS serves requests; four is the realistic figure, and WSL2&#8217;s <code>processors=<\/code> setting should be 2 so the host keeps two for the Windows side.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">When Not to Run WSL2 on the Host<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If the server&#8217;s job is to serve production traffic, run the build elsewhere. The cost of WSL2 on a production host is not the idle 1 GB \u2014 it is the unbounded page cache growth during a build, which manifests on the Windows side as IIS request queueing and SQL Server memory grants waiting. A separate build agent or a container host removes the interference entirely. If you must co-locate, cap <code>memory=<\/code> at 25% of installed RAM, set <code>autoMemoryReclaim=gradual<\/code> in .wslconfig (WSL 2.0+), and keep the swap file off the system volume. Compare tiers on the <a href=\"https:\/\/windows-vps.org\/\">Windows Server hosting plans<\/a> against that 14 GB floor before you commit, since upgrading RAM later usually means a reboot and, on some providers, a migration.<\/p>\n\n","protected":false},"excerpt":{"rendered":"<p>A wsl &#8211;install -d Ubuntu-22.04 on a Windows Server 2022 guest with 8 GB RAM leaves vmmem holding 4.1 GB within twenty minutes, because WSL2 runs a real Linux kernel inside a utility VM and the VM&#8217;s memory is not returned to the host on an aggressive schedule. On a dedicated workstation that is invisible. &#8230; <a title=\"WSL2 on the Same VPS as IIS and SQL Server: RAM, vCPU, and Disk Math\" class=\"read-more\" href=\"https:\/\/windows-vps.org\/blog\/wsl2-windows-server-host-hardware-budget\/\" aria-label=\"Read more about WSL2 on the Same VPS as IIS and SQL Server: RAM, vCPU, and Disk Math\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":0,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-915","post","type-post","status-publish","format-standard","hentry","category-reviews"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.1 (Yoast SEO v26.1) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>WSL2 on the Same VPS as IIS and SQL Server: RAM, vCPU, and Disk Math - Windows VPS Blog<\/title>\n<meta name=\"description\" content=\"A wsl --install -d Ubuntu-22.04 on a Windows Server 2022 guest with 8 GB RAM leaves vmmem holding 4.1 GB within twenty minutes, because WSL2 runs a real\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/windows-vps.org\/blog\/wsl2-windows-server-host-hardware-budget\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"WSL2 on the Same VPS as IIS and SQL Server: RAM, vCPU, and Disk Math\" \/>\n<meta property=\"og:description\" content=\"WSL2 on the Same VPS as IIS and SQL Server: RAM, vCPU, and Disk Math\" \/>\n<meta property=\"og:url\" content=\"https:\/\/windows-vps.org\/blog\/wsl2-windows-server-host-hardware-budget\/\" \/>\n<meta property=\"og:site_name\" content=\"Windows VPS Blog\" \/>\n<meta property=\"article:published_time\" content=\"2026-10-23T22:46:03+00:00\" \/>\n<meta name=\"author\" content=\"windows-vps\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@myxiechengxuan\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"windows-vps\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/windows-vps.org\/blog\/wsl2-windows-server-host-hardware-budget\/\",\"url\":\"https:\/\/windows-vps.org\/blog\/wsl2-windows-server-host-hardware-budget\/\",\"name\":\"WSL2 on the Same VPS as IIS and SQL Server: RAM, vCPU, and Disk Math - Windows VPS Blog\",\"isPartOf\":{\"@id\":\"https:\/\/windows-vps.org\/blog\/#website\"},\"datePublished\":\"2026-10-23T22:46:03+00:00\",\"author\":{\"@id\":\"https:\/\/windows-vps.org\/blog\/#\/schema\/person\/44caceed916d0db318aa08d5623a7a58\"},\"description\":\"A wsl --install -d Ubuntu-22.04 on a Windows Server 2022 guest with 8 GB RAM leaves vmmem holding 4.1 GB within twenty minutes, because WSL2 runs a real\",\"breadcrumb\":{\"@id\":\"https:\/\/windows-vps.org\/blog\/wsl2-windows-server-host-hardware-budget\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/windows-vps.org\/blog\/wsl2-windows-server-host-hardware-budget\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/windows-vps.org\/blog\/wsl2-windows-server-host-hardware-budget\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/windows-vps.org\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"WSL2 on the Same VPS as IIS and SQL Server: RAM, vCPU, and Disk Math\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/windows-vps.org\/blog\/#website\",\"url\":\"https:\/\/windows-vps.org\/blog\/\",\"name\":\"Windows VPS Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/windows-vps.org\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/windows-vps.org\/blog\/#\/schema\/person\/44caceed916d0db318aa08d5623a7a58\",\"name\":\"windows-vps\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/windows-vps.org\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/3f2573db5afcd1a6ab9abcc5d48fc8e42584bc87ab9d98cc156e5b2097766dd9?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/3f2573db5afcd1a6ab9abcc5d48fc8e42584bc87ab9d98cc156e5b2097766dd9?s=96&d=mm&r=g\",\"caption\":\"windows-vps\"},\"sameAs\":[\"https:\/\/windows-vps.org\/blog\",\"https:\/\/x.com\/myxiechengxuan\"],\"url\":\"https:\/\/windows-vps.org\/blog\/author\/myxiechengxuan\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"WSL2 on the Same VPS as IIS and SQL Server: RAM, vCPU, and Disk Math - Windows VPS Blog","description":"A wsl --install -d Ubuntu-22.04 on a Windows Server 2022 guest with 8 GB RAM leaves vmmem holding 4.1 GB within twenty minutes, because WSL2 runs a real","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/windows-vps.org\/blog\/wsl2-windows-server-host-hardware-budget\/","og_locale":"en_US","og_type":"article","og_title":"WSL2 on the Same VPS as IIS and SQL Server: RAM, vCPU, and Disk Math","og_description":"WSL2 on the Same VPS as IIS and SQL Server: RAM, vCPU, and Disk Math","og_url":"https:\/\/windows-vps.org\/blog\/wsl2-windows-server-host-hardware-budget\/","og_site_name":"Windows VPS Blog","article_published_time":"2026-10-23T22:46:03+00:00","author":"windows-vps","twitter_card":"summary_large_image","twitter_creator":"@myxiechengxuan","twitter_misc":{"Written by":"windows-vps","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/windows-vps.org\/blog\/wsl2-windows-server-host-hardware-budget\/","url":"https:\/\/windows-vps.org\/blog\/wsl2-windows-server-host-hardware-budget\/","name":"WSL2 on the Same VPS as IIS and SQL Server: RAM, vCPU, and Disk Math - Windows VPS Blog","isPartOf":{"@id":"https:\/\/windows-vps.org\/blog\/#website"},"datePublished":"2026-10-23T22:46:03+00:00","author":{"@id":"https:\/\/windows-vps.org\/blog\/#\/schema\/person\/44caceed916d0db318aa08d5623a7a58"},"description":"A wsl --install -d Ubuntu-22.04 on a Windows Server 2022 guest with 8 GB RAM leaves vmmem holding 4.1 GB within twenty minutes, because WSL2 runs a real","breadcrumb":{"@id":"https:\/\/windows-vps.org\/blog\/wsl2-windows-server-host-hardware-budget\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/windows-vps.org\/blog\/wsl2-windows-server-host-hardware-budget\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/windows-vps.org\/blog\/wsl2-windows-server-host-hardware-budget\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/windows-vps.org\/blog\/"},{"@type":"ListItem","position":2,"name":"WSL2 on the Same VPS as IIS and SQL Server: RAM, vCPU, and Disk Math"}]},{"@type":"WebSite","@id":"https:\/\/windows-vps.org\/blog\/#website","url":"https:\/\/windows-vps.org\/blog\/","name":"Windows VPS Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/windows-vps.org\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/windows-vps.org\/blog\/#\/schema\/person\/44caceed916d0db318aa08d5623a7a58","name":"windows-vps","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/windows-vps.org\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/3f2573db5afcd1a6ab9abcc5d48fc8e42584bc87ab9d98cc156e5b2097766dd9?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3f2573db5afcd1a6ab9abcc5d48fc8e42584bc87ab9d98cc156e5b2097766dd9?s=96&d=mm&r=g","caption":"windows-vps"},"sameAs":["https:\/\/windows-vps.org\/blog","https:\/\/x.com\/myxiechengxuan"],"url":"https:\/\/windows-vps.org\/blog\/author\/myxiechengxuan\/"}]}},"_links":{"self":[{"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/posts\/915","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/comments?post=915"}],"version-history":[{"count":1,"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/posts\/915\/revisions"}],"predecessor-version":[{"id":918,"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/posts\/915\/revisions\/918"}],"wp:attachment":[{"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/media?parent=915"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/categories?post=915"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/tags?post=915"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}