[英]Windows Host Docker + WSL2 - How to mount Windows directory to a Linux container
[英]wsl2 DISPLAY variable on windows host
我使用 Windows 10 和 WSL2。 要在 windows 機器托管的 X 服務器上運行 linux 應用程序,我使用第二個命令:export WSL_HOST_IP=$( cmd.exe /C netsh interface ip show addresses "vEthernet (WSL)" | grep "IP Address" | sed - e "s/\\s IP Address:\\s //g" ) 並且它有效:
回聲 $WSL_HOST_IP 172.20.48.1
我如何將其轉換為 DISPLAY 變量? 我想得到的是: DISPLAY = $WSL_HOST_IP:0.0 但我不能在 bash 中寫“:0.0”。 有人幫我嗎? 提前致謝
您需要刪除以s/\\r//
結尾的 DOS 行:
export WSL_HOST_IP=$( cmd.exe /C netsh interface ip show addresses "vEthernet (WSL)" | grep "IP Address" | sed -e "s/\sIP Address:\s//g; s/\r//" )
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.