1. 添加用戶、設置密碼、安裝 sudo 工具
使用以下命令添加用戶
useradd -m -g users -G network,storage,power,wheel,uucp -s /bin/bash josh
passwd josh
參考 useradd 參數
- -m 創建home目錄
- -g 主用戶群:user
- -G 附屬用戶群,其中 wheel 用于使用 sudo、su 命令
- -s 啟動 shell 設定
安裝 sudo 工具:
pacman -S sudo
為了使用戶可以通過 sudo 獲得 root 權限,還需要作如下設置:
nano /etc/sudoers
使用命令:
visudo
找到如下字樣部分:
# %wheel ALL=(ALL) ALL
取消注釋,使所有 wheel 組用戶可以使用 sudo 命令。保存文件,退出?,F在可以用 logout 命令登出 Linux,再用你自己的用戶名登錄了。
重新登陸。pacman 全局更新
$ pacman -Syu
修改 .bashrc 文件,增加 ll
alias ll = 'ls -al --color=auto'
安裝 vim、emacs
$ pacman -S vim emacs
sudo pacman -S xorg-server xorg-xinit xorg-server-utils mesa
pacman -Syu virtualbox-guest-utils
sudo nano /etc/modules-load.d/virtualbox.conf
Once Guest Additions are installed, we need to make sure that the various components of this software are loaded automatically each time the system boots. To do this, we’ll use nano to create a new configuration file called ‘virtualbox.conf’. This file will go in the ‘/etc/modules-load.d’ directory, which contains files that need to be loaded when Arch boots up. Since adding a file to this directory requires administrative permissions, we’ll need to precede our command with ‘sudo’ once again:
sudo nano /etc/modules-load.d/virtualbox.conf
When nano brings up the blank file, add these three lines to it:
vboxguest
vboxsf
vboxvideo
As usual, when you’re finished entering text in nano, type Control-X to exit to the command line, and answer ‘y’ for yes when you’re asked whether you want to save your work, and then hit ‘Return’ to accept the filename.
At this point, reboot your machine for the Guest Additions to take effect.
sudo reboot
Upon rebooting, your system should automatically connect to the internet, and Guest Additions should load up as part of the boot process.
By installing Guest Additions, we’re working toward better integration between our host and guest OSes. One example is that we can sync our Arch Linux install’s clock with that of the host system by entering the following command. This will enable synching on the next boot:
sudo systemctl enable vboxservice.service
But enough with the clock. At this point, we want to see if X is working, since we need it to be functional before we can install and use a GUI desktop.
To this end, we’ll install a few software packages that will help us test X:
sudo pacman -S xorg-twm xorg-xclock xterm
After these software packages have been installed, we can test that Xorg is installed correctly by running the command:
startx