VirtualBox上安裝Debian10個人備忘筆記


准備

VirtualBox

下載鏈接:Downloads – Oracle VM VirtualBox,下載完成后安裝即可。

Debian

下載鏈接:通過 HTTP/FTP 下載 Debian CD/DVD 映像

下載說明:

從下載頁面可以看到有兩個介質的下載,如果你希望最大限度的離線安裝的話,可以選擇DVD版本

這里本人選擇CD介質中的amd64,進入后會看到下方有一系列的ISO,到底該下載哪個呢?其實在DVD介質頁面里面已經給了說明:

There are lots of files here! Do I need all of them?
In most cases it is not necessary to download and use all of these images to be able to install Debian on your computer. Debian comes with a massive set of software packages, hence why it takes so many disks for a complete set. Most typical users only need a small subset of those software packages.

Initially, you will only need to download and use the first image of a set (labelled as debian-something-1 to be able to start the Debian installer and set up Debian on your computer. If there are more images available here (labelled debian-something-2, debian-something-3, etc.), they contain the extra packages that can be installed on a Debian system (as mentioned previously). They will not be bootable and are entirely optional. If you have a fast Internet connection, you're most likely better off installing any desired extra packages directly from the Debian mirrors on the Internet instead of by using these extra images.

簡而言之,下載Debian-XXX-1.iso的即可,其他的都是可選包,可以通過網絡下載。

安裝過程

VirtualBox

VirtualBox的安裝沒有什么特殊的處理,Python的支持可以去掉,然后安裝路徑按需放置。

安裝完成后,進入VirtualBox創建一個新的虛擬機:Machine -> New

接下來的進行Create,等待VirtualBox進行虛擬機的磁盤存儲等初始化操作。這個過程的處理時間取決於工作電腦的處理器和磁盤類型。

Debian

啟動並選擇鏡像

一系列的安裝過程

由於步驟很多,詳情可以參考這篇很有用的知乎文章:圖解 Debian 10(Buster)安裝步驟 - 知乎 (zhihu.com)

環境初始化

添加用戶到sudoers

# 1.切換到root用戶
$ su

# 2.編輯sudoer文件
$ vi /etc/sudoers

# 3.在User privilege specification一行復制root對應的內容,添加一行當前用戶的記錄,內容為
w4ngzhen(你的用戶名,本人使用的w4ngzhen) ALL=(ALL:ALL) ALL

# 4.強制保存

# 5.退出root用戶
$ exit

sudo方式修改apt源

實際上該步驟可以在上述安裝Debian的時候就可以選擇鏡像完成配置,這里寫出來主要是為了方便以后查閱修改鏡像。

# 1.編輯apt源配置文件
$ sudo vi /etc/apt/sources.list

# 2.添加國內能快速訪問的鏡像源,這里選擇騰訊。修改完成后,保存退出到命令行
deb http://mirrors.cloud.tencent.com/debian/ buster main non-free contrib
deb http://mirrors.cloud.tencent.com/debian-security buster/updates main
deb http://mirrors.cloud.tencent.com/debian/ buster-updates main non-free contrib
deb http://mirrors.cloud.tencent.com/debian/ buster-backports main non-free contrib
deb-src http://mirrors.cloud.tencent.com/debian-security buster/updates main
deb-src http://mirrors.cloud.tencent.com/debian/ buster main non-free contrib
deb-src http://mirrors.cloud.tencent.com/debian/ buster-updates main non-free contrib
deb-src http://mirrors.cloud.tencent.com/debian/ buster-backports main non-free contrib

# 3.更新apt源
$ sudo apt-get update

# 4.更新apt已安裝包
$ sudo apt-get upgrade

安裝linux-headers

# linux-headers的版本需要與當前內核發行版一致,查看內核發行版本命令如下:
$ uname -r
# 本人機器輸出:4.19.0-9-amd64
# 所以需要安裝的linux-headers為:linux-headers-4.19.0-9-amd64,這里使用shell命令便捷操作
$ sudo apt-get install -y linux-headers-$(uname -r) 

安裝gcc、make、perl等

$ sudo apt-get install -y gcc make perl

問題及解決

VBox啟動Debian/Xfce圖形界面黑屏

  • 原因1:VBox虛擬機【設置】-【顯示】中啟用了3D加速
  • 解決方式:關閉3D加速


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM