{"id":24629,"date":"2022-07-07T17:17:33","date_gmt":"2022-07-07T16:17:33","guid":{"rendered":"https:\/\/ekiwi-blog.de\/?p=24629"},"modified":"2022-07-07T20:03:30","modified_gmt":"2022-07-07T19:03:30","slug":"wsl2-improve-rendering-at-high-dpi-for-graphical-applications","status":"publish","type":"post","link":"https:\/\/ekiwi-blog.de\/en\/24629\/wsl2-improve-rendering-at-high-dpi-for-graphical-applications\/","title":{"rendered":"WSL2: Improve rendering at high DPI for graphical applications"},"content":{"rendered":"<p>Graphical Linux applications in WSL2 too small?<\/p>\n<p><!--more--><\/p>\n<p>In Windows 11, the new Linux environment (WSL2) can now also run graphical programs. These are displayed in a separate window and can be used like normal Windows programs.<\/p>\n<p>However, there are problems with devices that use a high resolution, such as my <a href=\"https:\/\/ekiwi-blog.de\/24576\/microsoft-surface-pro-tablet-vor-und-nachteile\/\" target=\"_blank\" rel=\"noopener\">Microsoft Surface Pro 7<\/a>.<\/p>\n<p><iframe loading=\"lazy\" width=\"560\" height=\"315\" src=\"https:\/\/www.youtube.com\/embed\/csa293IBuuw\" title=\"YouTube video player\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe><\/p>\n<p>The Linux applications were displayed with the native resolution by default, not with the Windows scaling. The display was thus very small and barely legible.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2022\/07\/wsl_1.jpg\" alt=\"\" width=\"800\" height=\"635\" class=\"aligncenter size-full wp-image-24622\" srcset=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2022\/07\/wsl_1.jpg 800w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2022\/07\/wsl_1-300x238.jpg 300w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2022\/07\/wsl_1-768x610.jpg 768w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2022\/07\/wsl_1-100x80.jpg 100w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/p>\n<h2>Configure High DPI for Linux Applications for Windows Subsystem for Linux<\/h2>\n<p>For the configuration, we create a file named &#8220;.wslgconfig&#8221; in the following folder:<\/p>\n<pre>\r\nc:\\ProgramData\\Microsoft\\WSL\\\r\n<\/pre>\n<p>Admin rights are necessary for access. To do this, we best start an editor with admin rights. In the file we insert the following lines:<\/p>\n<pre>\r\n[system-distro-env]\r\nWESTON_RDP_DISABLE_FRACTIONAL_HI_DPI_SCALING=false\r\n<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2022\/07\/wsl_2.jpg\" alt=\"\" width=\"1001\" height=\"336\" class=\"aligncenter size-full wp-image-24624\" srcset=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2022\/07\/wsl_2.jpg 1001w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2022\/07\/wsl_2-300x101.jpg 300w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2022\/07\/wsl_2-768x258.jpg 768w\" sizes=\"auto, (max-width: 1001px) 100vw, 1001px\" \/><\/p>\n<p>Done! Now we have to restart the Linux subsystem. For this we open a Powershell, also with admin rights. With the following command, we restart the Linux subsystem:<\/p>\n<pre>\r\nwsl --shutdown\r\n<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2022\/07\/wsl_3.jpg\" alt=\"\" width=\"448\" height=\"134\" class=\"aligncenter size-full wp-image-24626\" srcset=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2022\/07\/wsl_3.jpg 448w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2022\/07\/wsl_3-300x90.jpg 300w\" sizes=\"auto, (max-width: 448px) 100vw, 448px\" \/><\/p>\n<p>If we now start the GUI application again, it will scale like our Windows applications.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2022\/07\/wsl_4.jpg\" alt=\"\" width=\"800\" height=\"907\" class=\"aligncenter size-full wp-image-24628\" srcset=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2022\/07\/wsl_4.jpg 800w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2022\/07\/wsl_4-265x300.jpg 265w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2022\/07\/wsl_4-768x871.jpg 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/p>","protected":false},"excerpt":{"rendered":"<p>Graphical Linux applications in WSL2 too small?<\/p>\n","protected":false},"author":1,"featured_media":15926,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1555],"tags":[1558,2068],"class_list":["post-24629","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software-en","tag-windows-en","tag-windows-en-2"],"_links":{"self":[{"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/posts\/24629","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/comments?post=24629"}],"version-history":[{"count":0,"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/posts\/24629\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/media\/15926"}],"wp:attachment":[{"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/media?parent=24629"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/categories?post=24629"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/tags?post=24629"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}