# 办公-NAS All in one

## <mark style="color:red;">一键部署NAS软件的脚本↓</mark>

[<mark style="color:purple;">**https://github.com/wukongdaily/diy-nas-onescript**</mark>](https://github.com/wukongdaily/diy-nas-onescript)

<div align="left"><figure><img src="https://github.com/wukongdaily/diy-nas-onescript/assets/143675923/8451a7b5-267e-411e-b47d-d3f00f882397" alt="" width="563"><figcaption></figcaption></figure></div>

## 1、安装必备的办公和远程控制软件

{% hint style="info" %}
WPS、QQ、微信、VScode、远程桌面RustDesk
{% endhint %}

## **2、启用SSH 服务**

```sh
sudo apt-get install openssh-server
```

## 3、安装虚拟机

{% hint style="info" %}
下载run格式的virtualbox 7

<https://www.virtualbox.org/wiki/Linux_Downloads>

其中，点击 【[​All distributions](https://download.virtualbox.org/virtualbox/7.0.12/VirtualBox-7.0.12-159484-Linux_amd64.run) 】

或者使用命令行下载和执行
{% endhint %}

```sh
# 下载虚拟机安装包run，并保存为virtualbox7.run
wget -O virtualbox7.run https://download.virtualbox.org/virtualbox/7.0.12/VirtualBox-7.0.12-159484-Linux_amd64.run
sh virtualbox7.run

```

{% hint style="info" %}
利用virtualbox自带的命令行将img 转换为vdi 方便导入虚拟机virtualbox7
{% endhint %}

<pre class="language-sh"><code class="lang-sh"># 格式转换，超级快，一行代码搞定
VBoxManage convertfromraw /path/to/source.img /path/to/target.vdi --format VDI

# 转换之后的vdi 要赋予最高权限 777  这样才可以确保VirtualBox 虚拟机调用
<strong>sudo chmod 777 /path/to/target.vdi
</strong>
</code></pre>

#### 如何卸载VirtualBox 7 虚拟机

```
sh /opt/VirtualBox/uninstall.sh 

```

## 安装虚拟机扩展包（USB设备）

{% embed url="<https://download.virtualbox.org/virtualbox/7.0.12/Oracle_VM_VirtualBox_Extension_Pack-7.0.12.vbox-extpack>" %}

#### 如何用命令行安装VirtualBox 7 扩展包（识别USB设备）

<pre class="language-bash"><code class="lang-bash"><strong>wget https://download.virtualbox.org/virtualbox/7.0.12/Oracle_VM_VirtualBox_Extension_Pack-7.0.12.vbox-extpack
</strong>echo "y" | sudo VBoxManage extpack install --replace Oracle_VM_VirtualBox_Extension_Pack-7.0.12.vbox-extpack
sudo VBoxManage list extpacks
sudo groupadd usbfs
sudo adduser $USER vboxusers
sudo adduser $USER usbfs
echo "VM 扩展包安装完成,重启后才能生效。重启后USB才可以被虚拟机识别"

</code></pre>

## 4、安装CasaOS（ Docker）

{% hint style="danger" %}

<pre><code><strong>准备工作：补全 udevil 和 mergerfs
</strong></code></pre>

{% endhint %}

<pre class="language-bash"><code class="lang-bash"># 安装深度deepin缺少的依赖包udevil
wget https://mirrors-i.tuna.tsinghua.edu.cn/debian/pool/main/u/udevil/udevil_0.4.4-3_amd64.deb
sudo dpkg -i udevil_0.4.4-3_amd64.deb
# 安装深度deepin缺少的依赖包mergerfs
wget https://mirrors.sohu.com/deepin/pool/main/m/mergerfs/mergerfs_2.24.2-4_amd64.deb
sudo dpkg -i mergerfs_2.24.2-4_amd64.deb
<strong>
</strong></code></pre>

<figure><img src="/files/05MHGpOs65ICjMOqWPPg" alt=""><figcaption><p>一般在深度deepin系统下是无法使用CasaOS的会报错</p></figcaption></figure>

{% hint style="danger" %}

<pre><code><strong>准备工作：
</strong><strong>由于CasaOS暂时没有适配深度deepin v23系统,但适配了标准的Debian 12。
</strong>而深度deepin系统恰好是基于debian 12制作的，嘿，那就先伪装一下debian 12/bookworm 
从而让CasaOS的脚本顺利通过。
暂时修改一下/etc/os-release 中的ID和VERSION_CODENAME
</code></pre>

{% endhint %}

#### <mark style="color:red;">备份一下配置文件</mark>

```bash
# 备份一下原始文件
sudo cp /etc/os-release /etc/os-release.backup

```

#### 修改系统名称和代号，待CasaOS安装成功后，还原回来。

```bash
sudo sed -i -e 's/^ID=.*$/ID=debian/' -e 's/^VERSION_CODENAME=.*$/VERSION_CODENAME=bookworm/' /etc/os-release

```

<figure><img src="/files/hvEsdk3h8qQKHMp24clv" alt=""><figcaption></figcaption></figure>

{% hint style="danger" %}
安装CasaOS需要的文件位于github，因此建议挂代理访问来加速下载过程。
{% endhint %}

```bash
# 在深度deepin v23（debian 12） 系统下安装CasaOS
wget -qO- https://get.casaos.io | sudo bashbase
```

## <mark style="color:red;">安装成功后,记得将系统名称还原回来</mark>

```bash
# CasaOS安装成功之后,要记得还原配置文件
sudo mv /etc/os-release.backup /etc/os-release

```

#### 如何卸载 CasaOS

```
casaos-uninstall
```

## 配置docker国内镜像

<pre class="language-bash"><code class="lang-bash">
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json &#x3C;&#x3C;-'EOF'
{
  "registry-mirrors": [
    "https://0b27f0a81a00f3560fbdc00ddd2f99e0.mirror.swr.myhuaweicloud.com",
    "https://ypzju6vq.mirror.aliyuncs.com",
    "https://registry.docker-cn.com",
    "http://hub-mirror.c.163.com",
    "https://docker.mirrors.ustc.edu.cn"
  ]
}
EOF
sudo systemctl daemon-reload
<strong>sudo systemctl restart docker
</strong></code></pre>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://didiboy0702.gitbook.io/copy-of-bi-ji/ban-gong-nas-all-in-one.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
