Ubuntu 一行命令裝軟體——VirtualBox

語言: CN / TW / HK

highlight: vs2015

導讀

因為平時開發中難免要執行一些 demo,試用一些軟體。這個過程難免會造成電腦配置、環境的汙染和破壞,解決這個問題的思路也簡單,就是用虛擬機器。用虛擬機器裝的系統,如果環境髒了,直接刪除重新起一個就行了。所以安裝虛擬機器可謂是這個系列最基礎的一步,安排。

正文

VirtualBox

Ubuntu 下的虛擬機器一般使用 VirtualBox,安裝比較簡單,用 apt-get 即可。 bash sudo apt install virtualbox -y

iSO

再就是映象的下載了,既然是一行命令系列,那當然不能 low low 的用網頁下載了。另外,用國內映象也是必須的,這裡就用清華大學的映象服務。直接上命令 bash cd ~/Downloads curl -O https://mirrors.tuna.tsinghua.edu.cn/ubuntu-releases/20.04.4/ubuntu-20.04.4-desktop-amd64.iso 注意,-O 表示下載的檔案與遠端檔名相同,所以以上命令等同於 bash curl -o ~/Downloads/ubuntu-20.04.4-desktop-amd64.iso https://mirrors.tuna.tsinghua.edu.cn/ubuntu-releases/20.04.4/ubuntu-20.04.4-desktop-amd64.iso 各位按偏好取用就好。再附上其他常用系統的映象地址: ```bash

centOS

https://mirrors.tuna.tsinghua.edu.cn/centos/7.9.2009/isos/x86_64/CentOS-7-x86_64-Minimal-2009.iso https://mirrors.tuna.tsinghua.edu.cn/centos/7.9.2009/isos/x86_64/CentOS-7-x86_64-DVD-2009.iso

win10

https://software.download.prss.microsoft.com/sg/Win10_21H2_English_x64.iso?t=2b451169-6856-4c94-b8d2-08cf4c5af820&e=1650339010&h=e35ee324ce0553b6cc8f07c8e03d2944c9babd9d3507b171df98fcc39debd644 ```

使用

  1. 開啟 VirtualBox 之後,點選 New,配置好記憶體、硬碟,一直點 Next 就行了;
  2. 選中剛生成的虛擬機器,點 Settings,進入 Storage 選取;
  3. 點選 Start,選擇下載的映象,按照提示安裝即可;
  4. 重要:記得建立快照
  5. 開啟剪下板共享:Devices -> Shared Clipboard -> Bidirectional

一行命令

bash cd ~/Downloads && curl -sO https://mirrors.tuna.tsinghua.edu.cn/ubuntu-releases/20.04.4/ubuntu-20.04.4-desktop-amd64.iso & \ sudo apt install virtualbox -y