【问题标题】:Disk space for windows subsystem for linux (in case I have installed 2 WSL distribution)用于 linux 的 windows 子系统的磁盘空间(如果我安装了 2 个 WSL 发行版)
【发布时间】:2018-07-02 20:24:24
【问题描述】:

我不小心安装了两个 WSL 发行版(Ubuntu 和 Debian 应用程序),它们都构建了一些软件。

然后我意识到两者的/home/usr 是相互独立的,例如。我无法使用 Ubuntu 访问我使用 Debian 放置在 /home/usr 中的文件。是不是有不同的/home/usr

分配给子系统的磁盘空间是否有任何限制?或者只要我们的电脑有磁盘空间,我们就可以安装程序或数据? (和之前我使用虚拟机一样,有一个地方可以让我们为它们分配有限的磁盘存储)

如果我继续在我的电脑上保留这两个 WSL 发行版,会有什么不良后果吗?或者我应该删除其中一个?

非常感谢任何建议!谢谢你:)

【问题讨论】:

  • 1.没有磁盘空间的限制。 2. 两个发行版没有不良后果。
  • 感谢@Biswapriyo。还没有问题。但只是想知道,因为当我将实际文件放在其他发行版的 /home/usr 中时,我无法在一个发行版中访问 /home/usr 中的文件。那么每个发行版的/home/usr 都不同吗?谢谢,我对这些子系统还很陌生...

标签: ubuntu debian windows-subsystem-for-linux


【解决方案1】:

要访问另一个发行版文件,您必须配置两个发行版之间的 SSH 连接。让您想从 Debian 访问 Ubuntu 文件。图中:Debian (host) ------> Ubuntu (server)

在 Ubuntu 中创建 SSH 服务器:使用 root 用户执行这些命令

  • 清除 OpenSSH-Server 包:apt purge openssh-server
  • 安装 OpenSSH-Server 包:apt install openssh-server
  • 允许密码认证:sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config
  • 创建 SSH 密钥对:ssh-keygen -A
  • 重启sshd服务:service ssh --full-restart

使用 Debian SSH 客户端登录:安装 OpenSSH-Server 并允许密码验证如上

  • 连接SSH服务器:ssh username@localhost

建议不要在旧的 Windows 10 版本中关闭命令提示符。您也可以使用cd 命令访问文件。这是分布的两个根,即/ 路径(XYZ 是变量,取决于版本):

  • Debian:%LocalAppData%\Pacakges\TheDebianProject.DebianGNULinux_XYZ\LocalState\rootfs

  • Ubuntu:%LocalAppData%\Pacakges\CanonicalGroupLimited.UbuntuonWindows\LocalState\rootfs

相关链接:

【讨论】:

  • 您好,谢谢!所有步骤都可以完美运行,但我仍然无法使用:sudo ssh ubuntu@localhost 登录 ubuntu(反之亦然)。消息是:The authenticity of host 'localhost (127.0.0.1)' can't be established. ECDSA key fingerprint is xxxxxxx' Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'localhost' (ECDSA) to the list of known hosts. ubuntu@localhost's password: Permission denied, please try again. 是无法建立吗?密码是指ubuntu root的密码还是ssh密码? (好像我没有设置ssh密码……)
  • 是的!我已经运行了这个命令。是的,它显示:[ ok ] Starting OpenBSD Secure Shell server: sshd. 在 Debian 中,` * Starting OpenBSD Secure Shell server sshd [ OK ]` 在 Ubuntu 中。如何找到 ssh 服务器的发行版?谢谢!!
  • 好的,ubuntu@localhost's password: 是指 root/sudo 的意思吗?谢谢!
  • 须藤密码。不是根
猜你喜欢
  • 2021-04-23
  • 2019-07-03
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-05-21
  • 2020-09-24
  • 1970-01-01
  • 2021-05-05
相关资源
最近更新 更多