Mình mới nghiên cứu thử nghiệm Arch Linux sau nhiều năm chỉ biết đến Ubuntu và CentOS. Cứ tưởng có kinh nghiệm dùng Linux nên cài Arch không có gì khó, ai ngờ khó không tưởng
Nội dung chính Hiển thị
- 2. Tải Arch Linux ISO
- 2. Sửa lỗi không thể boot từ file ISO
- 3. Thiết lập hệ thống trước khi cài đặt
- Kiểm tra kết nối mạng
- Thiết lập SSH, Root Password
- Kết nối SSH vào máy ảo
- Thiết lập bố cục bàn phím
- Update time for system
- mirrorlist setting setting
- Disk Partition
- Format partition
- 4. Cài đặt hệ thống
- Cài đặt hệ thống cơ sở
- Tạo tệp fstab
- Cài đặt thêm các gói cần thiết
- Cài đặt bộ tải khởi động
- Cấu hình boot loader
- Configure time time
- Config language
- Thay đổi tên máy chủ
- Thay đổi mật khẩu root
- Create new account
- Kích hoạt dịch vụ mạng
- Kích hoạt dịch vụ SSH
- Khởi động lại hệ thống
- 5. Cài đặt giao diện GUI
- Cài đặt Gnome
- Cài đặt trình điều khiển video
- Điều chỉnh tốc độ phân giải
- Destination to results
- Bài viết liên quan
Arch Linux cung cấp 1 trang hướng dẫn cài đặt cực kỳ chi tiết tại đây. Hướng dẫn cài đặt. Nhưng chi tiết quá đến mức rắc rối, càng xem càng không biết cài đặt sao mới đúng
Bài viết này mình chia sẻ lại toàn bộ các bước cài đặt Arch Linux lên máy ảo Hyper-V. Để dành sau này cần sử dụng tài liệu còn có để tham khảo lại
Hướng dẫn này mình sử dụng máy ảo Hyper-V, nhưng bạn hoàn toàn có thể áp dụng các bước dưới đây để cài đặt Arch Linux lên máy ảo VirtualBox, ESXi, Promox hoặc cài đặt trực tiếp lên Máy tính để bàn / Máy tính xách tay
Cảnh báo. Nếu bạn mới tìm hiểu Linux, tốt nhất nên chuyển qua dùng Ubuntu hoặc Mint cho nhẹ đầu. Sử dụng vô anh Arch Linux này sẽ cực kỳ thử thách cho những người chưa quen với comand-line
- 1. Tạo máy ảo mới
- 2. Tải Arch Linux ISO
- 2. Sửa lỗi không thể boot từ file ISO
- 3. Thiết lập hệ thống trước khi cài đặt
- Kiểm tra kết nối mạng
- Thiết lập SSH, Root Password
- Kết nối SSH vào máy ảo
- Thiết lập bố cục bàn phím
- Update time for system
- mirrorlist setting setting
- Disk Partition
- Format partition
- 4. Cài đặt hệ thống
- Cài đặt hệ thống cơ sở
- Tạo tệp fstab
- Chroot
- Cài đặt thêm các gói cần thiết
- Cài đặt bộ tải khởi động
- Cấu hình boot loader
- Tạo trao đổi
- Configure time time
- Config language
- Thay đổi tên máy chủ
- Thay đổi mật khẩu root
- Create new account
- Kích hoạt dịch vụ mạng
- Kích hoạt dịch vụ SSH
- Khởi động lại hệ thống
- 5. Cài đặt giao diện GUI
- Cài đặt Gnome
- Cài đặt trình điều khiển video
- Điều chỉnh tốc độ phân giải
- Destination to results
Việc tạo máy ảo mới trên Hyper-V mình đã chia sẻ trong bài viết trước. You can't tham khảo bên dưới
Chú thích. Nhớ chọn máy ảo thế hệ 2 và kết nối với Switch bên ngoài hoặc Switch mặc định để có thể kết nối Internet khi cài đặt
2. Tải Arch Linux ISO
Bạn cần tải xuống tệp iso cài đặt Arch Linux từ trang Tải xuống. Hoặc truy cập vào Mirror nằm trên server Việt Nam của Bizflycloud để tải nhanh. http. //gương. bizflycloud. vn/archlinux/iso/latest/
2. Sửa lỗi không thể boot từ file ISO
Phiên bản ISO Arch Linux 202108 [archlinux-2021. 08. 01-x86_64. iso] gặp lỗi khi cài đặt trên Hyper-V như sau
ERROR: '/dev/disk/by-label/ARCH_202108' device did not show up after 30 seconds...
Lý do là vì Hyper-V tự động giải phóng ổ đĩa sau khi khởi động, khiến quá trình cài đặt gặp lỗi [FS#71934. archlinux-2021. 08. 01-x86_64. iso không khởi động được trên hyper-v] Để sửa lỗi này, mình bấm vào mục Phương tiện -> Ổ đĩa DVD -> Chèn đĩa để chọn lại tệp ISO cài đặt
Sau đó quay lại console gõ lệnh
udevadm trigger
exit
Quá trình cài đặt sẽ chạy liên tục
Hiện tại file iso bản mới archlinux-2021. 09. 01-x86_64. isodefault this error. Mình chia sẻ lại lỗi ở đây, biết đâu trong tương lai có bản nào bị lỗi còn nhớ cách sửa
3. Thiết lập hệ thống trước khi cài đặt
Kiểm tra kết nối mạng
Arch Linux cần phải kết nối Internet để tải các gói trong quá trình cài đặt. Kiểm tra máy ảo có kết nối Internet không bằng lệnh ping
ping gooogle.com
Nếu thấy tín hiệu phản hồi nhận được có nghĩa là máy ảo đang kết nối Internet OK
Tiếp theo kiểm tra địa chỉ IP hiện tại của máy ảo. Bạn cần ghi nhớ lại IP này để kết nối SSH vào máy ảo ở bước sau
ip a
IP của máy ảo.
systemctl start sshd
7Thiết lập SSH, Root Password
Thao tác tác vụ trực tiếp trên giao diện của Hyper-V không thuận tiện cho việc cài đặt vì nó không cho phép sao chép / dán dòng lệnh. Do đó, bạn nên thiết lập SSH Server để sử dụng Terminal / Putty kết nối vào sẽ dễ sử dụng hơn
Thiết lập mật khẩu cho tài khoản root
passwd
Kích hoạt dịch vụ SSH
systemctl start sshd
Kết nối SSH vào máy ảo
Sử dụng Putty [Windows] hoặc Terminal [MacOS / Linux] để kết nối SSH vào máy ảo theo địa chỉ IP với tài khoản gốc và mật khẩu đã thiết lập
ssh [email protected]
login as:root
Keyboard-interactive authentication prompts from server:
| Password:
End of keyboard-interactive prompts from server
To install Arch Linux follow the installation guide:
//wiki.archlinux.org/title/Installation_guide
For Wi-Fi, authenticate to the wireless network using the iwctl utility.
For mobile broadband [WWAN] modems, connect with the mmcli utility.
Ethernet, WLAN and WWAN interfaces using DHCP should work automatically.
After connecting to the internet, the installation guide can be accessed
via the convenience script Installation_guide.
Last login: Thu Sep 2 08:56:22 2021
[email protected] ~ #
Thiết lập bố cục bàn phím
Mặc định Arch Linux đã kích hoạt layout bàn phím US – là loại đang được sử dụng phổ biến tại Việt Nam. This step to do not doing anything more. Nếu bạn sử dụng bố cục bàn phím kiểu khác, hãy tham khảo hướng dẫn ở đây. https. //wiki. Archlinux. org/title/Installation_guide#Set_the_keyboard_layout
Update time for system
timedatectl set-ntp true
Check back by command
udevadm trigger
exit
0udevadm trigger
exit
0mirrorlist setting setting
Mirror List là danh sách repo mà Arch Linux sử dụng để tải xuống các gói cài đặt. Để tối ưu hóa tốc độ tải, mình sử dụng mirror từ Việt Nam và Hongkong
udevadm trigger
exit
1Bạn có thể truy cập vào https. //archlinux. org/mirrorlist/ to create mirror list
Save back mirrorlist default
udevadm trigger
exit
2Tạo lại danh sách mới
systemctl start sshd
8udevadm trigger
exit
3Add to mirrorlist at on, save back and exit [Ctrl+O, Ctrl + X]
udevadm trigger
exit
1Disk Partition
Kiểm tra ổ đĩa bằng lệnh
systemctl start sshd
9udevadm trigger
exit
5Sử dụng
ssh [email protected]
0 để thiết lập phân vùng cho ổ đĩa ssh [email protected]
1udevadm trigger
exit
6udevadm trigger
exit
7Nếu ổ cứng có sẵn dữ liệu và bạn muốn xóa sạch để cài đặt mới hoàn toàn, hãy sử dụng lệnh
ssh [email protected]
2udevadm trigger
exit
8Tạo phân vùng EFI bằng lệnh
ssh [email protected]
3, dung lượng 512MBudevadm trigger
exit
9Tạo phân vùng gốc sử dụng toàn bộ dung lượng còn lại của ổ cứng
ping gooogle.com
0Mình không tạo phân vùng hoán đổi theo hướng dẫn của Arch Linux Wiki. Hoán đổi có thể tạo bằng tệp trên phân vùng gốc, không cần thiết phải sử dụng phân vùng riêng
Kiểm tra lại thông tin trước khi xác nhận thiết lập phân vùng bằng lệnh
ssh [email protected]
4ping gooogle.com
1Save back setting partition up hard drive by
ssh [email protected]
5ping gooogle.com
2Format partition
Kiểm tra lại hệ thống phân vùng bằng lệnh
systemctl start sshd
9ping gooogle.com
3Định dạng phân vùng EFI
ping gooogle.com
4Định dạng phân vùng gốc
ping gooogle.com
5Gắn phân vùng vào hệ thống
ping gooogle.com
64. Cài đặt hệ thống
Cài đặt hệ thống cơ sở
Sử dụng
ssh [email protected]
7 để cài đặt hệ thống cơ sởping gooogle.com
7Tạo tệp fstab
ping gooogle.com
8Chroot
Truy cập vào hệ thống thông qua tài khoản gốc
ping gooogle.com
9Cài đặt thêm các gói cần thiết
ip a
0Nếu máy sử dụng CPU AMD, bạn nhớ đổi
ssh [email protected]
8 thành ssh [email protected]
9Cài đặt bộ tải khởi động
ip a
1Kết quả
ip a
2Cấu hình boot loader
ip a
3____34Update bootloader
ip a
5Tạo trao đổi
Tạo file hoán đổi có kích thước tương đương với dung lượng RAM của máy
ip a
6Kích hoạt hoán đổi
ip a
7Edit file
login as:root
Keyboard-interactive authentication prompts from server:
| Password:
End of keyboard-interactive prompts from server
To install Arch Linux follow the installation guide:
//wiki.archlinux.org/title/Installation_guide
For Wi-Fi, authenticate to the wireless network using the iwctl utility.
For mobile broadband [WWAN] modems, connect with the mmcli utility.
Ethernet, WLAN and WWAN interfaces using DHCP should work automatically.
After connecting to the internet, the installation guide can be accessed
via the convenience script Installation_guide.
Last login: Thu Sep 2 08:56:22 2021
[email protected] ~ #
0 để bổ sung trao đổi thông tinip a
8Add this lines to bottom
ip a
9Configure time time
Chỉnh sửa hệ thống về múi giờ Việt Nam
passwd
0Config language
Edit language system to en_US. UTF-8 UTF-8
passwd
1Chỉnh sửa thông số LANG trong tệp
login as:root
Keyboard-interactive authentication prompts from server:
| Password:
End of keyboard-interactive prompts from server
To install Arch Linux follow the installation guide:
//wiki.archlinux.org/title/Installation_guide
For Wi-Fi, authenticate to the wireless network using the iwctl utility.
For mobile broadband [WWAN] modems, connect with the mmcli utility.
Ethernet, WLAN and WWAN interfaces using DHCP should work automatically.
After connecting to the internet, the installation guide can be accessed
via the convenience script Installation_guide.
Last login: Thu Sep 2 08:56:22 2021
[email protected] ~ #
1passwd
2Thay đổi tên máy chủ
Sử dụng lệnh sau để đặt tên máy [tên máy chủ] thành ‘thuanbui-arch’
passwd
3Thay đổi mật khẩu root
passwd
4Create new account
Mình tạo tài khoản
login as:root
Keyboard-interactive authentication prompts from server:
| Password:
End of keyboard-interactive prompts from server
To install Arch Linux follow the installation guide:
//wiki.archlinux.org/title/Installation_guide
For Wi-Fi, authenticate to the wireless network using the iwctl utility.
For mobile broadband [WWAN] modems, connect with the mmcli utility.
Ethernet, WLAN and WWAN interfaces using DHCP should work automatically.
After connecting to the internet, the installation guide can be accessed
via the convenience script Installation_guide.
Last login: Thu Sep 2 08:56:22 2021
[email protected] ~ #
2 mới dùng để quản lý hệ thốngpasswd
5Đặt mật khẩu cho tài khoản mới
passwd
6Thiết lập quyền sudo cho tài khoản mới
passwd
7Bỏ bình luận # ở phía trước đoạn
login as:root
Keyboard-interactive authentication prompts from server:
| Password:
End of keyboard-interactive prompts from server
To install Arch Linux follow the installation guide:
//wiki.archlinux.org/title/Installation_guide
For Wi-Fi, authenticate to the wireless network using the iwctl utility.
For mobile broadband [WWAN] modems, connect with the mmcli utility.
Ethernet, WLAN and WWAN interfaces using DHCP should work automatically.
After connecting to the internet, the installation guide can be accessed
via the convenience script Installation_guide.
Last login: Thu Sep 2 08:56:22 2021
[email protected] ~ #
3 để trao quyền sudo cho thành viên thuộc nhóm login as:root
Keyboard-interactive authentication prompts from server:
| Password:
End of keyboard-interactive prompts from server
To install Arch Linux follow the installation guide:
//wiki.archlinux.org/title/Installation_guide
For Wi-Fi, authenticate to the wireless network using the iwctl utility.
For mobile broadband [WWAN] modems, connect with the mmcli utility.
Ethernet, WLAN and WWAN interfaces using DHCP should work automatically.
After connecting to the internet, the installation guide can be accessed
via the convenience script Installation_guide.
Last login: Thu Sep 2 08:56:22 2021
[email protected] ~ #
4Kích hoạt dịch vụ mạng
passwd
8Kích hoạt dịch vụ SSH
passwd
9Khởi động lại hệ thống
Thoát khỏi môi trường chroot
systemctl start sshd
0Khởi động lại máy
systemctl start sshd
15. Cài đặt giao diện GUI
Nếu không có gì bất thường, máy ảo sẽ khởi động lại rất nhanh vào bảng điều khiển tty. You may be login by account used before that
Chúc mừng bạn đã vượt qua giai đoạn khó khăn nhất trong cuộc thi cài đặt Arch Linux
Arch Linux đã hoạt động ngon lành ở chế độ cli. Tuy nhiên, nếu muốn sử dụng giao diện GUI như Windows hay MacOS, cần phải cài đặt thêm các gói quản lý Môi trường máy tính để bàn như GNOME, KDE, LXDE, i3,…
Cài đặt Gnome
Mình chọn cài đặt GNOME cho đơn giản
systemctl start sshd
2Cài đặt trình điều khiển video
Do mình đang dùng Hyper-V nên cần cài đặt thêm gói
login as:root
Keyboard-interactive authentication prompts from server:
| Password:
End of keyboard-interactive prompts from server
To install Arch Linux follow the installation guide:
//wiki.archlinux.org/title/Installation_guide
For Wi-Fi, authenticate to the wireless network using the iwctl utility.
For mobile broadband [WWAN] modems, connect with the mmcli utility.
Ethernet, WLAN and WWAN interfaces using DHCP should work automatically.
After connecting to the internet, the installation guide can be accessed
via the convenience script Installation_guide.
Last login: Thu Sep 2 08:56:22 2021
[email protected] ~ #
5 để XORG hoạt động trơn trusystemctl start sshd
3Điều chỉnh tốc độ phân giải
Virtual Virtual Virtual Virtual Virtual System sẽ được xác định sau khi khởi động. Để điều chỉnh tốc độ phân giải, cần phải thêm thông số
login as:root
Keyboard-interactive authentication prompts from server:
| Password:
End of keyboard-interactive prompts from server
To install Arch Linux follow the installation guide:
//wiki.archlinux.org/title/Installation_guide
For Wi-Fi, authenticate to the wireless network using the iwctl utility.
For mobile broadband [WWAN] modems, connect with the mmcli utility.
Ethernet, WLAN and WWAN interfaces using DHCP should work automatically.
After connecting to the internet, the installation guide can be accessed
via the convenience script Installation_guide.
Last login: Thu Sep 2 08:56:22 2021
[email protected] ~ #
6 vào kernel khởi độngsystemctl start sshd
4systemctl start sshd
5You can change
login as:root
Keyboard-interactive authentication prompts from server:
| Password:
End of keyboard-interactive prompts from server
To install Arch Linux follow the installation guide:
//wiki.archlinux.org/title/Installation_guide
For Wi-Fi, authenticate to the wireless network using the iwctl utility.
For mobile broadband [WWAN] modems, connect with the mmcli utility.
Ethernet, WLAN and WWAN interfaces using DHCP should work automatically.
After connecting to the internet, the installation guide can be accessed
via the convenience script Installation_guide.
Last login: Thu Sep 2 08:56:22 2021
[email protected] ~ #
7 to degradation mong muốn. Độ phân giải cho phép tối đa là login as:root
Keyboard-interactive authentication prompts from server:
| Password:
End of keyboard-interactive prompts from server
To install Arch Linux follow the installation guide:
//wiki.archlinux.org/title/Installation_guide
For Wi-Fi, authenticate to the wireless network using the iwctl utility.
For mobile broadband [WWAN] modems, connect with the mmcli utility.
Ethernet, WLAN and WWAN interfaces using DHCP should work automatically.
After connecting to the internet, the installation guide can be accessed
via the convenience script Installation_guide.
Last login: Thu Sep 2 08:56:22 2021
[email protected] ~ #
8Destination to results
systemctl start sshd
6tada. GNOME đã hiện ra
Because is done. Arch Linux đã được cài đặt thành công trên máy ảo Hyper-V để chờ bạn nghiên cứu
Arch Linux Wiki có thêm một số hướng dẫn tối ưu cho Hyper-V tại đây. Hyper-V – ArchWiki [archlinux. tổ chức]. Bạn nào quan tâm có thể tham khảo thêm