<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Linux &#8211; NhanVPH&#039;s Blog</title>
	<atom:link href="https://blntech.io.vn/category/system/linux/feed/" rel="self" type="application/rss+xml" />
	<link>https://blntech.io.vn</link>
	<description></description>
	<lastBuildDate>Fri, 29 May 2026 08:40:06 +0000</lastBuildDate>
	<language>vi</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0</generator>

<image>
	<url>https://blntech.io.vn/wp-content/uploads/2026/04/cropped-cropped-Logo-BLN-32x32.jpg</url>
	<title>Linux &#8211; NhanVPH&#039;s Blog</title>
	<link>https://blntech.io.vn</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>pfSense Lab – Phần 2 &#8211; Cài Đặt pfSense 2.5.x Lên Máy Ảo Hyper-V</title>
		<link>https://blntech.io.vn/pfsense-lab-phan-2-cai-dat-pfsense-2-5-x-len-may-ao-hyper-v/</link>
		
		<dc:creator><![CDATA[nhanvph]]></dc:creator>
		<pubDate>Fri, 29 May 2026 08:40:06 +0000</pubDate>
				<category><![CDATA[Firewall]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[Hyper-V]]></category>
		<category><![CDATA[pfSense]]></category>
		<category><![CDATA[Seri pfSense]]></category>
		<guid isPermaLink="false">https://blntech.io.vn/?p=1743</guid>

					<description><![CDATA[I. Cài đặt pfSense Khởi động máy ảo từ giao diện Hyper-V Manager. Đợi vài giây cho máy ảo khởi [&#8230;]]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">I. Cài đặt pfSense</h2>



<p class="wp-block-paragraph">Khởi động máy ảo từ giao diện Hyper-V Manager. Đợi vài giây cho máy ảo khởi động từ ổ quang ảo và làm theo hướng dẫn dưới đây để cài đặt pfSense lên máy ảo.</p>



<figure class="wp-block-image aligncenter size-large"><img fetchpriority="high" decoding="async" width="1024" height="870" src="https://blntech.io.vn/wp-content/uploads/2026/05/image-92-1024x870.png" alt="" class="wp-image-6453" srcset="https://blntech.io.vn/wp-content/uploads/2026/05/image-92-1024x870.png 1024w, https://blntech.io.vn/wp-content/uploads/2026/05/image-92-300x255.png 300w, https://blntech.io.vn/wp-content/uploads/2026/05/image-92-768x653.png 768w, https://blntech.io.vn/wp-content/uploads/2026/05/image-92.png 1026w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption">Chọn Accept</figcaption></figure>



<figure class="wp-block-image aligncenter size-large"><img decoding="async" width="1024" height="870" src="https://blntech.io.vn/wp-content/uploads/2026/05/image-93-1024x870.png" alt="" class="wp-image-6454" srcset="https://blntech.io.vn/wp-content/uploads/2026/05/image-93-1024x870.png 1024w, https://blntech.io.vn/wp-content/uploads/2026/05/image-93-300x255.png 300w, https://blntech.io.vn/wp-content/uploads/2026/05/image-93-768x653.png 768w, https://blntech.io.vn/wp-content/uploads/2026/05/image-93.png 1026w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption"><strong>Chọn Install và bấm OK</strong></figcaption></figure>



<figure class="wp-block-image aligncenter size-large"><img decoding="async" width="1024" height="870" src="https://blntech.io.vn/wp-content/uploads/2026/05/image-94-1024x870.png" alt="" class="wp-image-6455" srcset="https://blntech.io.vn/wp-content/uploads/2026/05/image-94-1024x870.png 1024w, https://blntech.io.vn/wp-content/uploads/2026/05/image-94-300x255.png 300w, https://blntech.io.vn/wp-content/uploads/2026/05/image-94-768x653.png 768w, https://blntech.io.vn/wp-content/uploads/2026/05/image-94.png 1026w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption"><strong>Giữ nguyên mặc định Continue with default keymap và bấm Select</strong></figcaption></figure>



<figure class="wp-block-image aligncenter size-large"><img loading="lazy" decoding="async" width="1024" height="870" src="https://blntech.io.vn/wp-content/uploads/2026/05/image-95-1024x870.png" alt="" class="wp-image-6456" srcset="https://blntech.io.vn/wp-content/uploads/2026/05/image-95-1024x870.png 1024w, https://blntech.io.vn/wp-content/uploads/2026/05/image-95-300x255.png 300w, https://blntech.io.vn/wp-content/uploads/2026/05/image-95-768x653.png 768w, https://blntech.io.vn/wp-content/uploads/2026/05/image-95.png 1026w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption"><strong>Chọn Auto (ZFS) và bấm OK</strong></figcaption></figure>



<figure class="wp-block-image aligncenter size-large"><img loading="lazy" decoding="async" width="1024" height="870" src="https://blntech.io.vn/wp-content/uploads/2026/05/image-96-1024x870.png" alt="" class="wp-image-6457" srcset="https://blntech.io.vn/wp-content/uploads/2026/05/image-96-1024x870.png 1024w, https://blntech.io.vn/wp-content/uploads/2026/05/image-96-300x255.png 300w, https://blntech.io.vn/wp-content/uploads/2026/05/image-96-768x653.png 768w, https://blntech.io.vn/wp-content/uploads/2026/05/image-96.png 1026w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption"><strong>Chọn Select</strong></figcaption></figure>



<figure class="wp-block-image aligncenter size-large"><img loading="lazy" decoding="async" width="1024" height="870" src="https://blntech.io.vn/wp-content/uploads/2026/05/image-97-1024x870.png" alt="" class="wp-image-6458" srcset="https://blntech.io.vn/wp-content/uploads/2026/05/image-97-1024x870.png 1024w, https://blntech.io.vn/wp-content/uploads/2026/05/image-97-300x255.png 300w, https://blntech.io.vn/wp-content/uploads/2026/05/image-97-768x653.png 768w, https://blntech.io.vn/wp-content/uploads/2026/05/image-97.png 1026w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption"><strong>Chọn Stripe và bấm OK</strong></figcaption></figure>



<figure class="wp-block-image aligncenter size-large"><img loading="lazy" decoding="async" width="1024" height="870" src="https://blntech.io.vn/wp-content/uploads/2026/05/image-98-1024x870.png" alt="" class="wp-image-6459" srcset="https://blntech.io.vn/wp-content/uploads/2026/05/image-98-1024x870.png 1024w, https://blntech.io.vn/wp-content/uploads/2026/05/image-98-300x255.png 300w, https://blntech.io.vn/wp-content/uploads/2026/05/image-98-768x653.png 768w, https://blntech.io.vn/wp-content/uploads/2026/05/image-98.png 1026w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption"><strong>Bấm Spacebar để chọn da0 và bấm OK</strong></figcaption></figure>



<figure class="wp-block-image aligncenter size-large"><img loading="lazy" decoding="async" width="1024" height="870" src="https://blntech.io.vn/wp-content/uploads/2026/05/image-99-1024x870.png" alt="" class="wp-image-6460" srcset="https://blntech.io.vn/wp-content/uploads/2026/05/image-99-1024x870.png 1024w, https://blntech.io.vn/wp-content/uploads/2026/05/image-99-300x255.png 300w, https://blntech.io.vn/wp-content/uploads/2026/05/image-99-768x653.png 768w, https://blntech.io.vn/wp-content/uploads/2026/05/image-99.png 1026w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption"><strong>Chọn YES</strong></figcaption></figure>



<p class="wp-block-paragraph">Việc cài đặt diễn ra nhanh chóng, chỉ khoảng 1-2 phút.</p>



<figure class="wp-block-image aligncenter size-large"><img loading="lazy" decoding="async" width="1024" height="870" src="https://blntech.io.vn/wp-content/uploads/2026/05/image-100-1024x870.png" alt="" class="wp-image-6461" srcset="https://blntech.io.vn/wp-content/uploads/2026/05/image-100-1024x870.png 1024w, https://blntech.io.vn/wp-content/uploads/2026/05/image-100-300x255.png 300w, https://blntech.io.vn/wp-content/uploads/2026/05/image-100-768x653.png 768w, https://blntech.io.vn/wp-content/uploads/2026/05/image-100.png 1026w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption"><strong>Chọn No</strong></figcaption></figure>



<figure class="wp-block-image aligncenter size-large"><img loading="lazy" decoding="async" width="1024" height="870" src="https://blntech.io.vn/wp-content/uploads/2026/05/image-101-1024x870.png" alt="" class="wp-image-6462" srcset="https://blntech.io.vn/wp-content/uploads/2026/05/image-101-1024x870.png 1024w, https://blntech.io.vn/wp-content/uploads/2026/05/image-101-300x255.png 300w, https://blntech.io.vn/wp-content/uploads/2026/05/image-101-768x653.png 768w, https://blntech.io.vn/wp-content/uploads/2026/05/image-101.png 1026w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption"><strong>Chọn Shell để thoát ra giao diện dòng lệnh</strong></figcaption></figure>



<p class="wp-block-paragraph">Sau khi cài đặt xong, bạn không chọn Reboot, mà chọn Shell để thoát ra giao diện dòng lệnh. Gõ lệnh <code><strong>poweroff</strong></code> bấm Enter để tắt máy ảo.</p>



<p class="wp-block-paragraph">Tiếp theo truy cập lại vào Settings của máy ảo để cho Boot từ Hard Drive và tắt ổ quang ảo. Nếu bạn bỏ qua 2 thao tác này, máy ảo sẽ khởi động lại và tiếp tục Boot từ ổ DVD ảo và yêu cầu cài đặt lại.</p>



<figure class="wp-block-image aligncenter size-full"><img loading="lazy" decoding="async" width="722" height="682" src="https://blntech.io.vn/wp-content/uploads/2026/05/image-102.png" alt="" class="wp-image-6463" srcset="https://blntech.io.vn/wp-content/uploads/2026/05/image-102.png 722w, https://blntech.io.vn/wp-content/uploads/2026/05/image-102-300x283.png 300w" sizes="auto, (max-width: 722px) 100vw, 722px" /><figcaption class="wp-element-caption"><strong>Bấm vào mục Firmware, chỉnh Hard Drive lên đầu để ưu tiên khi khởi động máy ảo</strong></figcaption></figure>



<figure class="wp-block-image aligncenter size-full"><img loading="lazy" decoding="async" width="722" height="682" src="https://blntech.io.vn/wp-content/uploads/2026/05/image-103.png" alt="" class="wp-image-6464" srcset="https://blntech.io.vn/wp-content/uploads/2026/05/image-103.png 722w, https://blntech.io.vn/wp-content/uploads/2026/05/image-103-300x283.png 300w" sizes="auto, (max-width: 722px) 100vw, 722px" /><figcaption class="wp-element-caption"><strong>Bấm vào DVD Drive, chọn None</strong></figcaption></figure>



<p class="wp-block-paragraph">Bấm OK để lưu lại.</p>



<h2 class="wp-block-heading">II. Cấu hình cổng mạng</h2>



<p class="wp-block-paragraph">Ở lần khởi động đầu tiên sau khi cài đặt, pfSense sẽ yêu cầu thiết lập cổng mạng WAN và LAN.</p>



<figure class="wp-block-image aligncenter size-large"><img loading="lazy" decoding="async" width="1024" height="870" src="https://blntech.io.vn/wp-content/uploads/2026/05/image-104-1024x870.png" alt="" class="wp-image-6465" srcset="https://blntech.io.vn/wp-content/uploads/2026/05/image-104-1024x870.png 1024w, https://blntech.io.vn/wp-content/uploads/2026/05/image-104-300x255.png 300w, https://blntech.io.vn/wp-content/uploads/2026/05/image-104-768x653.png 768w, https://blntech.io.vn/wp-content/uploads/2026/05/image-104.png 1026w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption"><strong>Hệ thống hỏi có muốn thiết lập VLAN không? Chọn n (No) và Enter. VLAN có thể được thiết lập sau khi truy cập vào giao diện Web UI của pfSense</strong></figcaption></figure>



<figure class="wp-block-image aligncenter size-large"><img loading="lazy" decoding="async" width="1024" height="870" src="https://blntech.io.vn/wp-content/uploads/2026/05/image-105-1024x870.png" alt="" class="wp-image-6466" srcset="https://blntech.io.vn/wp-content/uploads/2026/05/image-105-1024x870.png 1024w, https://blntech.io.vn/wp-content/uploads/2026/05/image-105-300x255.png 300w, https://blntech.io.vn/wp-content/uploads/2026/05/image-105-768x653.png 768w, https://blntech.io.vn/wp-content/uploads/2026/05/image-105.png 1026w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption"><strong>Chọn cổng mạng WAN: gõ hn0 và Enter</strong></figcaption></figure>



<figure class="wp-block-image aligncenter size-large"><img loading="lazy" decoding="async" width="1024" height="870" src="https://blntech.io.vn/wp-content/uploads/2026/05/image-106-1024x870.png" alt="" class="wp-image-6467" srcset="https://blntech.io.vn/wp-content/uploads/2026/05/image-106-1024x870.png 1024w, https://blntech.io.vn/wp-content/uploads/2026/05/image-106-300x255.png 300w, https://blntech.io.vn/wp-content/uploads/2026/05/image-106-768x653.png 768w, https://blntech.io.vn/wp-content/uploads/2026/05/image-106.png 1026w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption"><strong>Chọn cổng mạng LAN: hn1, sau đó xác nhận bằng cách gõ y và Enter</strong></figcaption></figure>



<p class="wp-block-paragraph">Sau khi thiết lập cổng mạng, pfSense sẽ tiến hành cài đặt các dịch vụ cho hệ thống.</p>



<figure class="wp-block-image aligncenter size-large"><img loading="lazy" decoding="async" width="1024" height="870" src="https://blntech.io.vn/wp-content/uploads/2026/05/image-107-1024x870.png" alt="" class="wp-image-6468" srcset="https://blntech.io.vn/wp-content/uploads/2026/05/image-107-1024x870.png 1024w, https://blntech.io.vn/wp-content/uploads/2026/05/image-107-300x255.png 300w, https://blntech.io.vn/wp-content/uploads/2026/05/image-107-768x653.png 768w, https://blntech.io.vn/wp-content/uploads/2026/05/image-107.png 1026w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption"><strong>Giao diện dòng lệnh chính của pfSense</strong></figcaption></figure>



<p class="wp-block-paragraph">Cổng WAN (hn0) của pfSense kết nối vào External Switch nên được cấp DHCP IP từ Router Mikrotik: <code><strong>192.168.0.117</strong></code>. Mình sẽ đổi thành IP tĩnh <code><strong>192.168.0.200</strong></code> sau.</p>



<p class="wp-block-paragraph">Cổng LAN (hn0) được tự động cấp IP <code><strong>192.168.1.1</strong></code> đóng vài trò làm Gateway cho hệ thống mạng nội bộ được quản lý thông qua Private Switch. Mình sẽ đổi LAN IP thành <code><strong>10.0.0.1</strong></code> sau.</p>



<h2 class="wp-block-heading">III. Truy cập Web UI</h2>



<p class="wp-block-paragraph">Thiết lập mặc định của pfSense chỉ cho truy cập vào trang quản trị Web UI từ mạng LAN nội bộ. Do đó mình chưa thể truy cập vào địa chỉ <code><strong>192.168.0.117</strong></code>.</p>



<p class="wp-block-paragraph">Để có thể truy cập Web UI từ hệ điều hành Host (nằm trên mạng WAN), cần phải tắt dịch vụ quản lý gói tin (packet filter) bằng lệnh sau.</p>



<pre class="wp-block-preformatted"><code> pfctl -d</code></pre>



<figure class="wp-block-image aligncenter size-large"><img loading="lazy" decoding="async" width="1024" height="870" src="https://blntech.io.vn/wp-content/uploads/2026/05/image-108-1024x870.png" alt="" class="wp-image-6469" srcset="https://blntech.io.vn/wp-content/uploads/2026/05/image-108-1024x870.png 1024w, https://blntech.io.vn/wp-content/uploads/2026/05/image-108-300x255.png 300w, https://blntech.io.vn/wp-content/uploads/2026/05/image-108-768x653.png 768w, https://blntech.io.vn/wp-content/uploads/2026/05/image-108.png 1026w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption"><strong>Bấm 8 để truy cập Shell, gõ lệnh pfctl -d để tắt packet filter</strong></figcaption></figure>



<p class="wp-block-paragraph">Lệnh<strong> <code>pfctl -d</code> </strong>chỉ tạm thời tắt packet filter ở phiên làm việc hiện tại. Khi khởi động lại pfSense, packet filter sẽ tự động kích hoạt trở lại và ngăn truy cập từ WAN.</p>



<p class="wp-block-paragraph">Do đó, sau khi đã vào được Web UI, chúng ta sẽ thiết lập Firewall rule để cho phép truy cập pfSense từ WAN để khỏi gõ lệnh <code><strong>pfctl -d</strong></code> trong Shell nữa.</p>



<figure class="wp-block-image aligncenter size-large"><img loading="lazy" decoding="async" width="1024" height="679" src="https://blntech.io.vn/wp-content/uploads/2026/05/image-109-1024x679.png" alt="" class="wp-image-6470" srcset="https://blntech.io.vn/wp-content/uploads/2026/05/image-109-1024x679.png 1024w, https://blntech.io.vn/wp-content/uploads/2026/05/image-109-300x199.png 300w, https://blntech.io.vn/wp-content/uploads/2026/05/image-109-768x509.png 768w, https://blntech.io.vn/wp-content/uploads/2026/05/image-109.png 1360w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption"><strong>Đăng nhập vào Web UI của pfSense bằng IP WAN 192.168.0.117</strong></figcaption></figure>



<p class="wp-block-paragraph">Tên đăng nhập và mật khẩu mặc định của pfSense:</p>



<ul class="wp-block-list">
<li>Tên đăng nhập: <strong>admin</strong></li>



<li>Mật khẩu: <strong>pfsense</strong></li>
</ul>



<figure class="wp-block-image aligncenter size-large"><img loading="lazy" decoding="async" width="1024" height="679" src="https://blntech.io.vn/wp-content/uploads/2026/05/image-110-1024x679.png" alt="" class="wp-image-6471" srcset="https://blntech.io.vn/wp-content/uploads/2026/05/image-110-1024x679.png 1024w, https://blntech.io.vn/wp-content/uploads/2026/05/image-110-300x199.png 300w, https://blntech.io.vn/wp-content/uploads/2026/05/image-110-768x509.png 768w, https://blntech.io.vn/wp-content/uploads/2026/05/image-110.png 1360w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption"><strong>Đăng nhập thành công vào pfSense Web UI</strong></figcaption></figure>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p class="wp-block-paragraph">Bài viết kết thúc tại đây. Mình vừa mới hướng dẫn bạn cách cài đặt pfSense lên máy ảo Hyper-V.</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p class="wp-block-paragraph">Nguồn: thuanbui</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Cài Đặt Arch Linux Trên Máy Ảo Hyper-V</title>
		<link>https://blntech.io.vn/cai-dat-arch-linux-tren-may-ao-hyper-v/</link>
		
		<dc:creator><![CDATA[nhanvph]]></dc:creator>
		<pubDate>Fri, 29 May 2026 08:14:37 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[Arch-Linux]]></category>
		<category><![CDATA[Hyper-V]]></category>
		<guid isPermaLink="false">https://blntech.io.vn/?p=1932</guid>

					<description><![CDATA[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 Hướng [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">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</p>



<p class="wp-block-paragraph">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 hay cài trực tiếp lên Desktop / Laptop.</p>



<p class="wp-block-paragraph">***Lưu ý: Nếu bạn mới tìm hiểu Linux, tốt nhất nên dùng Ubuntu hoặc Mint. Đụng vô anh Arch Linux này sẽ cực kỳ thử thách cho những người chưa quen comand-line.</p>



<h2 class="wp-block-heading">1. Tạo máy ảo mới</h2>



<p class="wp-block-paragraph">Việc tạo máy ảo mới trên Hyper-V mình đã chia sẻ trong bài viết trước. Bạn có thể tham khảo bên dưới.</p>



<p class="wp-block-paragraph"><strong>Tạo máy ảo bằng Hyper-V trong Windows 10</strong></p>



<p class="wp-block-paragraph">Chú ý: Nhớ chọn máy ảo Generation 2 và kết nối vào External Switch hoặc Default Switch để có thể kết nối Internet trong khi cài đặt.</p>



<h2 class="wp-block-heading">2. Tải Arch Linux ISO</h2>



<p class="wp-block-paragraph">Bạn cần tải file iso cài đặt Arch Linux từ trang&nbsp;<a href="https://archlinux.org/download/" target="_blank" rel="noreferrer noopener">Download</a>. Hoặc truy cập thằng vào Mirror nằm trên server Việt Nam của Bizflycloud để tải cho nhanh:&nbsp;<a href="http://mirror.bizflycloud.vn/archlinux/iso/latest/" target="_blank" rel="noreferrer noopener"></a><a href="http://mirror.bizflycloud.vn/archlinux/iso/latest/" target="_blank" rel="noreferrer noopener">http://mirror.bizflycloud.vn/archlinux/iso/latest/</a></p>



<h2 class="wp-block-heading">3. Sửa lỗi không thể boot từ file ISO</h2>



<p class="wp-block-paragraph">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:</p>



<pre class="wp-block-preformatted"><code>ERROR: '/dev/disk/by-label/ARCH_202108' device did not show up after 30 seconds...</code></pre>



<figure class="wp-block-image aligncenter size-full"><img loading="lazy" decoding="async" width="1024" height="768" src="https://blntech.io.vn/wp-content/uploads/2025/07/image-565.png" alt="" class="wp-image-6442" srcset="https://blntech.io.vn/wp-content/uploads/2025/07/image-565.png 1024w, https://blntech.io.vn/wp-content/uploads/2025/07/image-565-300x225.png 300w, https://blntech.io.vn/wp-content/uploads/2025/07/image-565-768x576.png 768w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">Lý do vì Hyper-V tự động nhả ổ đĩa sau khi khởi động, khiến tiến trình cài đặt gặp lỗi (<a href="https://bugs.archlinux.org/task/71934" target="_blank" rel="noreferrer noopener">FS#71934 : archlinux-2021.08.01-x86_64.iso fails to boot on hyper-v</a>) Để sửa lỗi này, mình bấm vào mục Media -&gt; DVD Drive -&gt; Insert Disk để chọn lại file ISO cài đặt.</p>



<figure class="wp-block-image aligncenter size-large"><img loading="lazy" decoding="async" width="1024" height="870" src="https://blntech.io.vn/wp-content/uploads/2025/07/image-566-1024x870.png" alt="" class="wp-image-6443" srcset="https://blntech.io.vn/wp-content/uploads/2025/07/image-566-1024x870.png 1024w, https://blntech.io.vn/wp-content/uploads/2025/07/image-566-300x255.png 300w, https://blntech.io.vn/wp-content/uploads/2025/07/image-566-768x653.png 768w, https://blntech.io.vn/wp-content/uploads/2025/07/image-566.png 1026w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">Sau đó quay lại console gõ lệnh</p>



<pre class="wp-block-preformatted"><code>udevadm trigger<br>exit</code></pre>



<figure class="wp-block-image aligncenter size-full"><img loading="lazy" decoding="async" width="1024" height="768" src="https://blntech.io.vn/wp-content/uploads/2025/07/image-567.png" alt="" class="wp-image-6444" srcset="https://blntech.io.vn/wp-content/uploads/2025/07/image-567.png 1024w, https://blntech.io.vn/wp-content/uploads/2025/07/image-567-300x225.png 300w, https://blntech.io.vn/wp-content/uploads/2025/07/image-567-768x576.png 768w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">Quá trình cài đặt sẽ chạy tiếp tục</p>



<figure class="wp-block-image aligncenter size-full"><img loading="lazy" decoding="async" width="1024" height="768" src="https://blntech.io.vn/wp-content/uploads/2025/07/image-568.png" alt="" class="wp-image-6445" srcset="https://blntech.io.vn/wp-content/uploads/2025/07/image-568.png 1024w, https://blntech.io.vn/wp-content/uploads/2025/07/image-568-300x225.png 300w, https://blntech.io.vn/wp-content/uploads/2025/07/image-568-768x576.png 768w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">Hiện tại file iso bản mới archlinux-2021.09.01-x86_64.iso khắc phục lỗi này. Mình chia sẻ lại lỗi ở đây, biết đâu trong tương lai có bản nào bị lỗi tiếp còn nhớ cách sửa.</p>



<h2 class="wp-block-heading">3. Thiết lập hệ thống trước khi cài đặt</h2>



<h3 class="wp-block-heading">Kiểm tra kết nối mạng</h3>



<p class="wp-block-paragraph">Arch Linux cần phải kết nối Internet để tải các package trong quá trình cài đặt. Kiểm tra máy ảo có kết nối Internet chưa bằng lệnh ping</p>



<pre class="wp-block-preformatted"><code>ping gooogle.com</code></pre>



<p class="wp-block-paragraph">Nếu thấy nhận được tín hiệu phản hồi nghĩa là máy ảo đang kết nối Internet OK.</p>



<p class="wp-block-paragraph">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</p>



<pre class="wp-block-preformatted"><code>ip a</code></pre>



<figure class="wp-block-image aligncenter size-full"><img loading="lazy" decoding="async" width="1024" height="768" src="https://blntech.io.vn/wp-content/uploads/2025/07/image-569.png" alt="" class="wp-image-6446" srcset="https://blntech.io.vn/wp-content/uploads/2025/07/image-569.png 1024w, https://blntech.io.vn/wp-content/uploads/2025/07/image-569-300x225.png 300w, https://blntech.io.vn/wp-content/uploads/2025/07/image-569-768x576.png 768w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">IP của máy ảo: <code><strong>192.168.0.166</strong></code></p>



<h3 class="wp-block-heading">Thiết lập SSH, Root Password</h3>



<p class="wp-block-paragraph">Việc thao tác trực tiếp trên giao diện của Hyper-V không tiện lợi cho việc cài đặt vì nó không cho phép copy / paste dòng lệnh. Do đó, bạn nên thiết lập SSH Server để dùng Terminal / Putty kết nối vào sẽ dễ sử dụng hơn.</p>



<p class="wp-block-paragraph">Thiết lập mật khẩu cho tài khoản root</p>



<pre class="wp-block-code"><code>passwd</code></pre>



<p class="wp-block-paragraph">Kích hoạt SSH Service</p>



<pre class="wp-block-preformatted"><code>systemctl start sshd</code></pre>



<h3 class="wp-block-heading">Kết nối SSH vào máy ảo</h3>



<p class="wp-block-paragraph">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 root và password đã thiết lập.</p>



<pre class="wp-block-preformatted"><code>ssh root@192.168.0.166</code></pre>



<pre class="wp-block-preformatted"><code>login as:root<br>Keyboard-interactive authentication prompts from server:<br>| Password:<br>End of keyboard-interactive prompts from server<br>To install Arch Linux follow the installation guide:<br>https://wiki.archlinux.org/title/Installation_guide<br><br>For Wi-Fi, authenticate to the wireless network using the iwctl utility.<br>For mobile broadband (WWAN) modems, connect with the mmcli utility.<br>Ethernet, WLAN and WWAN interfaces using DHCP should work automatically.<br><br>After connecting to the internet, the installation guide can be accessed<br>via the convenience script Installation_guide.<br><br>Last login: Thu Sep  2 08:56:22 2021<br>root@archiso ~ #</code></pre>



<h3 class="wp-block-heading">Thiết lập layout bàn phím</h3>



<p class="wp-block-paragraph">Mặc định Arch Linux đã kích hoạt layout bàn phím US – là loại đang sử dụng phổ biến ở Việt Nam. Nên bước này không cần làm gì thêm. Nếu bạn dùng layout bàn phím kiểu khác thì tham khảo hướng dẫn ở đây:&nbsp;<a href="https://wiki.archlinux.org/title/Installation_guide#Set_the_keyboard_layout" target="_blank" rel="noreferrer noopener"></a><a href="https://wiki.archlinux.org/title/Installation_guide#Set_the_keyboard_layout" target="_blank" rel="noreferrer noopener">https://wiki.archlinux.org/title/Installation_guide#Set_the_keyboard_layout</a></p>



<h3 class="wp-block-heading">Cập nhật thời gian cho hệ thống</h3>



<pre class="wp-block-preformatted"><code>timedatectl set-ntp true</code></pre>



<p class="wp-block-paragraph">Kiểm tra lại bằng lệnh</p>



<pre class="wp-block-preformatted"><code>timedatectl statu</code>s</pre>



<pre class="wp-block-preformatted"><code>root@archiso ~ </code># timedatectl status<code><br>               Local time: Thu 2021-09-02 09:11:39 UTC<br>           Universal time: Thu 2021-09-02 09:11:39 UTC<br>                 RTC time: Thu 2021-09-02 09:11:39<br>                Time zone: UTC (UTC, +0000)<br>System clock synchronized: yes<br>              NTP service: active<br>          RTC in local TZ: no</code></pre>



<h3 class="wp-block-heading">Thiết lập mirrorlist</h3>



<p class="wp-block-paragraph">Mirror List là danh sách repo mà Arch Linux sử dụng để tải các package cài đặt. Để tối ưu tốc độ tải, mình sử dụng các mirror từ Việt Nam và Hongkong.</p>



<pre class="wp-block-preformatted">##<br>## Arch Linux repository mirrorlist<br>## Generated on 2021-09-02<br>##<br><br>## Vietnam<code><br>Server = </code>&lt;http://mirror.bizflycloud.vn/archlinux/$repo/os/$arch><code><br><br></code>## Hong Kong<code><br></code>Server = &lt;https://asia.mirror.pkgbuild.com/$repo/os/$arch><br>Server = &lt;http://mirror-hk.koddos.net/archlinux/$repo/os/$arch><br>Server = &lt;https://mirror-hk.koddos.net/archlinux/$repo/os/$arch><br>Server = &lt;http://hkg.mirror.rackspace.com/archlinux/$repo/os/$arch><br>Server = &lt;https://hkg.mirror.rackspace.com/archlinux/$repo/os/$arch><br>Server = &lt;https://arch-mirror.wtako.net/$repo/os/$arch><br>Server = &lt;http://mirror.xtom.com.hk/archlinux/$repo/os/$arch><br>Server = &lt;https://mirror.xtom.com.hk/archlinux/$repo/os/$arch></pre>



<p class="wp-block-paragraph">Bạn có thể truy cập vào&nbsp;<a href="https://archlinux.org/mirrorlist/" target="_blank" rel="noreferrer noopener"></a><a href="https://archlinux.org/mirrorlist/" target="_blank" rel="noreferrer noopener">https://archlinux.org/mirrorlist/</a>&nbsp;để tạo danh sách mirror.</p>



<p class="wp-block-paragraph">Lưu lại mirrorlist mặc định</p>



<pre class="wp-block-preformatted"><code>mv /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.bk</code></pre>



<p class="wp-block-paragraph">Tạo lại danh sách mới <code><strong>/etc/pacman.d/mirrorlist</strong></code></p>



<pre class="wp-block-preformatted"><code>sudo nano /etc/pacman.d/mirrorlist</code></pre>



<p class="wp-block-paragraph">Thêm vào mirrorlist ở trên, lưu lại và thoát ra (Ctrl+O, Ctrl + X)</p>



<pre class="wp-block-preformatted">##<br>## Arch Linux repository mirrorlist<br>## Generated on 2021-09-02<br>##<br><br>## Vietnam<br>Server = &lt;http://mirror.bizflycloud.vn/archlinux/$repo/os/$arch><br><br>## Hong Kong<br>Server = &lt;https://asia.mirror.pkgbuild.com/$repo/os/$arch><br>Server = &lt;http://mirror-hk.koddos.net/archlinux/$repo/os/$arch><br>Server = &lt;https://mirror-hk.koddos.net/archlinux/$repo/os/$arch><br>Server = &lt;http://hkg.mirror.rackspace.com/archlinux/$repo/os/$arch><br>Server = &lt;https://hkg.mirror.rackspace.com/archlinux/$repo/os/$arch><br>Server = &lt;https://arch-mirror.wtako.net/$repo/os/$arch><br>Server = &lt;http://mirror.xtom.com.hk/archlinux/$repo/os/$arch><br>Server = &lt;https://mirror.xtom.com.hk/archlinux/$repo/os/$arch></pre>



<h3 class="wp-block-heading">Phân vùng ổ cứng</h3>



<p class="wp-block-paragraph">Kiểm tra ổ đĩa bằng lệnh&nbsp;<code>lsblk</code></p>



<pre class="wp-block-preformatted"><code>root@archiso ~ </code># lsblk<code><br>NAME  MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS<br>loop0   7:0    0 662.7M  1 loop /run/archiso/airootfs<br>sda     8:0    0    30G  0 disk <br>sr0    11:0    1 832.3M  0 rom  /run/archiso/bootmnt</code></pre>



<p class="wp-block-paragraph">Sử dụng <code><strong>gdisk</strong></code> để thiết lập phân vùng cho ổ đĩa <code><strong>/dev/sda</strong></code></p>



<pre class="wp-block-preformatted"><code>gdisk /dev/sda</code></pre>



<pre class="wp-block-preformatted"><code>root@archiso ~ </code># gdisk /dev/sda<code><br>GPT fdisk (gdisk) version 1.0.8<br><br>Partition table scan:<br>  MBR: not present<br>  BSD: not present<br>  APM: not present<br>  GPT: not present<br><br>Creating new GPT entries in memory.<br><br>Command (? for help):</code></pre>



<p class="wp-block-paragraph">Nếu ổ cứng có sẵn dữ liệu và bạn muốn xoá sạch sẽ để cài mới hoàn toàn, sử dụng command&nbsp;<code>o</code></p>



<pre class="wp-block-preformatted"><code>Command (? for help): o<br>This option deletes all partitions and creates a new protective MBR.<br>Proceed? (Y/N): Y</code></pre>



<p class="wp-block-paragraph">Tạo phân vùng EFI bằng command <code><strong>n</strong></code>, dung lượng 512MB</p>



<pre class="wp-block-preformatted"><code>Command (? for help): n<br>Partition number (1-128, default 1): 1<br>First sector (34-62914526, default = 2048) or {+-}size{KMGTP}: <br>Last sector (2048-62914526, default = 62914526) or {+-}size{KMGTP}: +512M<br>Current type is 8300 (Linux filesystem)<br>Hex code or GUID (L to show codes, Enter = 8300): EF00<br>Changed type of partition to 'EFI system partition'</code></pre>



<p class="wp-block-paragraph">Tạo tiếp phân vùng root sử dụng toàn bộ dung lượng còn lại của ổ cứng</p>



<pre class="wp-block-preformatted"><code>Command (? for help): n<br>Partition number (2-128, default 2): n<br>First sector (34-62914526, default = 1050624) or {+-}size{KMGTP}: <br>Last sector (1050624-62914526, default = 62914526) or {+-}size{KMGTP}: <br>Current type is 8300 (Linux filesystem)<br>Hex code or GUID (L to show codes, Enter = 8300): <br>Changed type of partition to 'Linux filesystem'</code></pre>



<p class="wp-block-paragraph">Mình không tạo phân vùng swap như hướng dẫn của Arch Linux Wiki. Swap có thể tạo bằng file trên phân vùng root, không cần phải dùng phân vùng riêng.</p>



<p class="wp-block-paragraph">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 <code><strong>p</strong></code></p>



<pre class="wp-block-preformatted"><code>Command (? for help): p<br>Disk /dev/sda: 62914560 sectors, 30.0 GiB<br>Model: Virtual Disk    <br>Sector size (logical/physical): 512/4096 bytes<br>Disk identifier (GUID): 18CFC37F-8E65-4FFE-B997-8C48BBE241E5<br>Partition table holds up to 128 entries<br>Main partition table begins at sector 2 and ends at sector 33<br>First usable sector is 34, last usable sector is 62914526<br>Partitions will be aligned on 2048-sector boundaries<br>Total free space is 2014 sectors (1007.0 KiB)<br><br>Number  Start (sector)    End (sector)  Size       Code  Name<br>   1            2048         1050623   512.0 MiB   EF00  EFI system partition<br>   2         1050624        62914526   29.5 GiB    8300  Linux filesystem</code></pre>



<p class="wp-block-paragraph">Lưu lại thiết lập phân vùng lên ổ cứng bằng lệnh <code><strong>w</strong></code></p>



<pre class="wp-block-preformatted"><code>Command (? for help): w<br><br>Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING<br>PARTITIONS!!<br><br>Do you want to proceed? (Y/N): Y<br>OK; writing new GUID partition table (GPT) to /dev/sda.<br>The operation has completed successfully.</code></pre>



<h3 class="wp-block-heading">Format phân vùng</h3>



<p class="wp-block-paragraph">Kiểm tra lại hệ thống phân vùng bằng lệnh <code><strong>lsblk</strong></code></p>



<pre class="wp-block-preformatted"><code>root@archiso ~ </code># lsblk<code><br>NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS<br>loop0    7:0    0 662.7M  1 loop /run/archiso/airootfs<br>sda      8:0    0    30G  0 disk <br>├─sda1   8:1    0   512M  0 part <br>└─sda2   8:2    0  29.5G  0 part <br>sr0     11:0    1 832.3M  0 rom  /run/archiso/bootmnt</code></pre>



<p class="wp-block-paragraph">Format phân vùng EFI</p>



<pre class="wp-block-code"><code>mkfs.fat -F32 /dev/sda1</code></pre>



<p class="wp-block-paragraph">Format phân vùng root</p>



<pre class="wp-block-code"><code>mkfs.ext4 /dev/sda2</code></pre>



<p class="wp-block-paragraph">Mount phân vùng vào hệ thống</p>



<pre class="wp-block-preformatted"><code>mount /dev/sda2 /mnt<br>mkdir /mnt/boot<br>mount /dev/sda1 /mnt/boot</code></pre>



<h2 class="wp-block-heading">4. Cài đặt hệ thống</h2>



<h3 class="wp-block-heading">Cài đặt base system</h3>



<p class="wp-block-paragraph">Sử dụng&nbsp;<code>pacstrap</code>&nbsp;để cài đặt base system</p>



<pre class="wp-block-preformatted"><code>pacstrap /mnt base linux linux-firmware base-devel</code></pre>



<h3 class="wp-block-heading">Tạo fstab file</h3>



<pre class="wp-block-preformatted"><code>genfstab -U /mnt >> /mnt/etc/fstab</code></pre>



<h3 class="wp-block-heading">Chroot</h3>



<p class="wp-block-paragraph">Truy cập vào hệ thống qua tài khoản root</p>



<pre class="wp-block-code"><code>arch-chroot /mnt</code></pre>



<h3 class="wp-block-heading">Cài đặt thêm các package cần thiết</h3>



<pre class="wp-block-preformatted"><code>pacman -S openssh nano intel-ucode networkmanager</code></pre>



<p class="wp-block-paragraph">Nếu máy sử dụng CPU AMD, bạn nhớ đổi <code><strong>intel-ucode</strong></code> thành <code><strong>amd-ucode</strong></code></p>



<h3 class="wp-block-heading">Cài đặt boot loader</h3>



<pre class="wp-block-preformatted"><code>bootctl install</code></pre>



<p class="wp-block-paragraph">Kết quả</p>



<pre class="wp-block-preformatted"><code>[root@archiso /]</code># bootctl install<code><br>Created "/boot/EFI".<br>Created "/boot/EFI/systemd".<br>Created "/boot/EFI/BOOT".<br>Created "/boot/loader".<br>Created "/boot/loader/entries".<br>Created "/boot/EFI/Linux".<br>Copied "/usr/lib/systemd/boot/efi/systemd-bootx64.efi" to "/boot/EFI/systemd/systemd-bootx64.efi".<br>Copied "/usr/lib/systemd/boot/efi/systemd-bootx64.efi" to "/boot/EFI/BOOT/BOOTX64.EFI".<br>Created "/boot/d28ebfbb52b245528e50eff03fdd37e7".<br>Random seed file /boot/loader/random-seed successfully written (512 bytes).<br>Not installing system token, since we are running in a virtualized environment.<br>Created EFI boot entry "Linux Boot Manager".</code></pre>



<h3 class="wp-block-heading">Cấu hình boot loader</h3>



<pre class="wp-block-preformatted"><code>nano /boot/loader/loader.conf</code></pre>



<pre class="wp-block-preformatted"><code>default arch<br>timeout 3<br>editor 0</code></pre>



<p class="wp-block-paragraph">Cập nhật bootloader</p>



<pre class="wp-block-preformatted"><code>bootctl update</code></pre>



<h3 class="wp-block-heading">Tạo swap</h3>



<p class="wp-block-paragraph">Tạo file swap có kích thước tương đương với dung lượng RAM của máy.</p>



<pre class="wp-block-preformatted"><code>fallocate -l 2GiB /swapfile<br>chmod 600 /swapfile<br>mkswap /swapfile</code></pre>



<p class="wp-block-paragraph">Kích hoạt swap</p>



<pre class="wp-block-preformatted"><code>swapon /swapfile</code></pre>



<p class="wp-block-paragraph">Chỉnh sửa file <code><strong>fstab</strong></code> để bổ sung thông tin swap</p>



<pre class="wp-block-preformatted"><code>nano /etc/fstab</code></pre>



<p class="wp-block-paragraph">Thêm dòng này vào dưới cùng</p>



<pre class="wp-block-preformatted"><code>/swapfile none swap defaults 0 0</code></pre>



<h3 class="wp-block-heading">Cấu hình múi giờ</h3>



<p class="wp-block-paragraph">Chỉnh hệ thống về múi giờ Việt Nam</p>



<pre class="wp-block-preformatted"><code>ln -sf /usr/share/zoneinfo/Asia/Ho_Chi_Minh /etc/localtime<br>hwclock — systohc</code></pre>



<h3 class="wp-block-heading">Cấu hình ngôn ngữ</h3>



<p class="wp-block-paragraph">Chỉnh ngôn ngữ hệ thống thành <strong>en_US.UTF-8 UTF-8</strong></p>



<pre class="wp-block-preformatted"><code>echo 'en_US.UTF-8 UTF-8' > /etc/locale.gen<br>locale-gen</code></pre>



<p class="wp-block-paragraph">Chỉnh thông số LANG trong file <code><strong>/etc/locale.conf</strong></code></p>



<pre class="wp-block-preformatted"><code>echo 'LANG=en_US.UTF-8' > /etc/locale.conf</code></pre>



<h3 class="wp-block-heading">Thay đổi hostname</h3>



<p class="wp-block-paragraph">Sử dụng lệnh sau để đặt tên máy (hostname) thành ‘thuanbui-arch’</p>



<pre class="wp-block-preformatted"><code>echo 'thuanbui-arch' > /etc/hostname</code></pre>



<h3 class="wp-block-heading">Thay đổi mật khẩu root</h3>



<pre class="wp-block-preformatted"><code>passwd</code></pre>



<h3 class="wp-block-heading">Tạo tài khoản mới</h3>



<p class="wp-block-paragraph">Mình tạo tài khoản <code><strong>thuanbui</strong></code> mới dùng để quản lý hệ thống</p>



<pre class="wp-block-preformatted"><code>useradd -m -G wheel -s /bin/bash -c "Thuan Bui" thuanbui</code></pre>



<p class="wp-block-paragraph">Đặt mật khẩu cho tài khoản mới</p>



<pre class="wp-block-preformatted"><code>passwd thuanbui</code></pre>



<p class="wp-block-paragraph">Thiết lập quyền sudo cho tài khoản mới</p>



<pre class="wp-block-code"><code>EDITOR=nano visudo</code></pre>



<p class="wp-block-paragraph">Bỏ comment # ở phía trước đoạn <code><strong>%wheel ALL=(ALL) ALL</strong></code> để đưa quyền sudo cho thành viên thuộc group <code><strong>group</strong></code></p>



<h3 class="wp-block-heading">Kích hoạt network services</h3>



<pre class="wp-block-preformatted"><code>systemctl enable NetworkManager</code></pre>



<h3 class="wp-block-heading">Kích hoạt SSH Service</h3>



<pre class="wp-block-preformatted"><code>systemctl enable sshd</code></pre>



<h3 class="wp-block-heading">Khởi động lại hệ thống</h3>



<p class="wp-block-paragraph">Thoát ra khỏi môi trường chroot</p>



<pre class="wp-block-preformatted"><code>exit</code></pre>



<p class="wp-block-paragraph">Khởi động lại máy</p>



<pre class="wp-block-code"><code>reboot</code></pre>



<h2 class="wp-block-heading">5. Cài đặt giao diện GUI</h2>



<p class="wp-block-paragraph">Nếu không có gì bất thường, máy ảo sẽ khởi động lại rất nhanh vào tty console. Bạn có thể đăng nhập bằng tài khoản đã tạo trước đó.</p>



<figure class="wp-block-image aligncenter size-full"><img loading="lazy" decoding="async" width="1024" height="768" src="https://blntech.io.vn/wp-content/uploads/2025/07/image-570.png" alt="" class="wp-image-6447" srcset="https://blntech.io.vn/wp-content/uploads/2025/07/image-570.png 1024w, https://blntech.io.vn/wp-content/uploads/2025/07/image-570-300x225.png 300w, https://blntech.io.vn/wp-content/uploads/2025/07/image-570-768x576.png 768w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">Chúc mừng bạn đã vượt qua được giai đoạn khó khăn nhất trong công cuộc cài đặt Arch Linux!</p>



<p class="wp-block-paragraph">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 package quản lý&nbsp;<a href="https://wiki.archlinux.org/title/Desktop_environment" target="_blank" rel="noreferrer noopener">Desktop Environment</a>&nbsp;như&nbsp;<a href="https://wiki.archlinux.org/title/GNOME" target="_blank" rel="noreferrer noopener">GNOME</a>,&nbsp;<a href="https://wiki.archlinux.org/title/KDE" target="_blank" rel="noreferrer noopener">KDE</a>,&nbsp;<a href="https://wiki.archlinux.org/title/LXDE" target="_blank" rel="noreferrer noopener">LXDE</a>,&nbsp;<a href="https://wiki.archlinux.org/title/I3" target="_blank" rel="noreferrer noopener">i3</a>,…</p>



<h3 class="wp-block-heading">Cài đặt GNOME</h3>



<p class="wp-block-paragraph">Mình chọn cài đặt GNOME cho đơn giản</p>



<pre class="wp-block-preformatted"><code>sudo pacman -S gnome<br>sudo systemctl enable --now gdm</code></pre>



<h3 class="wp-block-heading">Cài đặt video driver</h3>



<p class="wp-block-paragraph">Do mình đang dùng Hyper-V nên cần cài đặt thêm package <code><strong>xf86-video-fbdev</strong></code> để XORG hoạt động trơn tru.</p>



<pre class="wp-block-preformatted"><code>sudo pacman -S xf86-video-fbdev</code></pre>



<h3 class="wp-block-heading">Điều chỉnh độ phân giải</h3>



<p class="wp-block-paragraph">Độ phân giải của máy ảo sẽ cố định sau khi khởi động. Để điều chỉnh độ phân giải, cần phải thêm thông số <code><strong>video=hyperv_fb:1600x900</strong></code> vào boot kernel.</p>



<pre class="wp-block-preformatted"><code>sudo nano /boot/loader/entries/arch.conf</code></pre>



<pre class="wp-block-preformatted"><code>title   Arch Linux<br>linux   /vmlinuz-linux<br>initrd  /intel-ucode.img<br>initrd  /initramfs-linux.img<br>options video=hyperv_fb:1600x900 root=/dev/sda2 rw</code></pre>



<p class="wp-block-paragraph">Bạn có thể thay đổi <code><strong>1600x900</strong></code> thành độ phân giải mong muốn. Độ phân giải cho phép tối đa là <code><strong>1920x1080</strong></code></p>



<h3 class="wp-block-heading">Tận hưởng thành quả</h3>



<pre class="wp-block-preformatted"><code>sudo reboot</code></pre>



<p class="wp-block-paragraph">Tada! GNOME đã hiện ra!</p>



<figure class="wp-block-image aligncenter size-full"><img loading="lazy" decoding="async" width="1024" height="768" src="https://blntech.io.vn/wp-content/uploads/2025/07/image-571.png" alt="" class="wp-image-6448" srcset="https://blntech.io.vn/wp-content/uploads/2025/07/image-571.png 1024w, https://blntech.io.vn/wp-content/uploads/2025/07/image-571-300x225.png 300w, https://blntech.io.vn/wp-content/uploads/2025/07/image-571-768x576.png 768w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">Vậy là xong. Arch Linux đã được cài đặt thành công trên máy ảo Hyper-V để chờ bạn nghiên cứu.</p>



<p class="wp-block-paragraph">Arch Linux Wiki có thêm một số hướng dẫn tối ưu cho Hyper-V ở đây:&nbsp;<a href="https://wiki.archlinux.org/title/Hyper-V" target="_blank" rel="noreferrer noopener">Hyper-V – ArchWiki (archlinux.org)</a>. Bạn nào quan tâm có thể tham khảo thêm.</p>



<p class="wp-block-paragraph">Chúc bạn cài đặt êm xuôi!</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p class="wp-block-paragraph">Nguồn: thuanbui</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>SnipeIT &#8211; Phần Mềm Quản Lý Tài Sản Trên Ubuntu</title>
		<link>https://blntech.io.vn/snipeit-phan-mem-quan-ly-tai-san-tren-ubuntu/</link>
		
		<dc:creator><![CDATA[nhanvph]]></dc:creator>
		<pubDate>Fri, 10 Apr 2026 06:45:30 +0000</pubDate>
				<category><![CDATA[Audit]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[SnipeIT]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<guid isPermaLink="false">https://blntech.io.vn/?p=3071</guid>

					<description><![CDATA[Giới Thiệu Trong mỗi công ty, doanh nghiệp có rất nhiều tài sản khác nhau: laptop, máy tính, màn hình, [&#8230;]]]></description>
										<content:encoded><![CDATA[
<h4 class="wp-block-heading"><strong>Giới Thiệu</strong></h4>



<p class="wp-block-paragraph">Trong mỗi công ty, doanh nghiệp có rất nhiều tài sản khác nhau: laptop, máy tính, màn hình, tivi, camera, license, điện thoại, …</p>



<p class="wp-block-paragraph">Việc quản lý những tài sản này là một vấn đề khá đau đầu, đặc biệt với các công ty có nhiều nhân viên thường xuyên ra vào nghỉ việc.</p>



<p class="wp-block-paragraph">Làm sao kiểm tra được ngay: hiện tại đang có bao nhiêu laptop, những ai đang sử dụng và lịch sử người dùng nó trước kia, các thông số kỹ thuật, hạn bảo hành, nhà cung cấp, giá tiền, lịch sử sữa chữa hư hỏng…</p>



<p class="wp-block-paragraph"><strong>Snipe IT</strong> là 1 phần mềm open source miễn phí sẽ giúp bạn xử lý các vấn đề trên</p>



<h4 class="wp-block-heading"><strong>Các Bước Cài Đặt</strong></h4>



<h5 class="wp-block-heading">Cài đặt Apache2 HTTP</h5>



<ul class="wp-block-list">
<li>Apache2 HTTP Server: là máy chủ web phổ biến, để cài đặt Apache2 HTTP trên máy chủ Ubuntu, các bạn hãy chạy các lệnh bên dưới đây</li>
</ul>



<pre class="wp-block-code"><code>sudo apt update

sudo apt install apache2</code></pre>



<ul class="wp-block-list">
<li>Bật tính năng khởi động dịch vụ Apache2 HTTP chạy cùng máy chủ Ubuntu mỗi khi khởi động lên</li>
</ul>



<pre class="wp-block-code"><code>sudo systemctl stop apache2.service

sudo systemctl start apache2.service

sudo systemctl enable apache2.service</code></pre>



<h5 class="wp-block-heading">Cài đặt máy chủ MariaDB Database</h5>



<ul class="wp-block-list">
<li>MariaDB Database: là ứng dụng quản lý lưu trữ dữ liệu cho SnipeIT, để cài đặt MariaDB, các bạn hãy chạy các lệnh bên dưới đây:</li>
</ul>



<pre class="wp-block-code"><code>sudo apt install mariadb-server mariadb-client</code></pre>



<ul class="wp-block-list">
<li>Bật tính năng khởi động dịch vụ MariaDB Database chạy cùng máy chủ Ubuntu mỗi khi khởi động lên</li>
</ul>



<pre class="wp-block-code"><code>sudo systemctl stop mariadb.service

sudo systemctl start mariadb.service

sudo systemctl enable mariadb.service</code></pre>



<ul class="wp-block-list">
<li>Để bảo mật máy chủ MariaDB, hãy tạo mật khẩu root và không cho phép truy cập root từ xa.</li>
</ul>



<pre class="wp-block-code"><code>sudo mysql_secure_installation</code></pre>



<ul class="wp-block-list">
<li>Sau đó làm theo như dưới:</li>
</ul>



<pre class="wp-block-code"><code>Enter current password for root (enter for none):  <strong>nhấn Enter</strong>

Set root password? &#91;Y/n]: <strong>Y</strong>

New password: <strong>nhập password mới</strong> bạn muốn đặt vào

Re-enter new password: <strong>nhập lại password</strong> vừa tạo ở trên

Remove anonymous users? &#91;Y/n]: <strong>Y</strong>

Disallow root login remotely? &#91;Y/n]: <strong>Y</strong>

Remove test database and access to it? &#91;Y/n]: <strong>Y</strong>

Reload privilege tables now? &#91;Y/n]: <strong>Y</strong></code></pre>



<ul class="wp-block-list">
<li>Để kiểm tra xem MariaDB đã được cài đặt chưa, gõ lệnh</li>
</ul>



<pre class="wp-block-code"><code>sudo mysql -u root -p</code></pre>



<ul class="wp-block-list">
<li>Sau đó, nhập mật khẩu root bạn đã tạo ở trên để đăng nhập… nếu thành công, bạn sẽ thấy thông báo chào mừng MariaDB</li>
</ul>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="635" height="183" src="https://blntech.io.vn/wp-content/uploads/2025/07/image-299.png" alt="" class="wp-image-5449" srcset="https://blntech.io.vn/wp-content/uploads/2025/07/image-299.png 635w, https://blntech.io.vn/wp-content/uploads/2025/07/image-299-300x86.png 300w" sizes="auto, (max-width: 635px) 100vw, 635px" /></figure>



<ul class="wp-block-list">
<li>Nhấn Ctrl C để trở về root</li>
</ul>



<h5 class="wp-block-heading">Cài đặt PHP và các Modules liên quan</h5>



<ul class="wp-block-list">
<li>PHP 7.2 có thể không có sẵn trong kho lưu trữ mặc định của Ubunt. Nên để cài đặt nó, bạn sẽ phải lấy từ kho của bên thứ ba, chạy lệnh sau:</li>
</ul>



<pre class="wp-block-code"><code>sudo apt-get install software-properties-common

sudo add-apt-repository ppa:ondrej/php

sudo apt update</code></pre>



<ul class="wp-block-list">
<li>Cài đặt các PHP module liên quan cần thiết để chạy được SnipeIT</li>
</ul>



<pre class="wp-block-code"><code>sudo apt install php7.2 libapache2-mod-php7.2 php7.2-common php7.2-gmp php7.2-curl php7.2-intl php7.2-mbstring php7.2-xmlrpc php7.2-mysql php7.2-gd php7.2-xml php7.2-cli php7.2-zip php7.2-sqlite php7.2-ldap</code></pre>



<ul class="wp-block-list">
<li>Sau khi cài đặt PHP 7.2, hãy chạy các lệnh bên dưới để mở tệp cấu hình mặc định PHP cho Apache2… Lưu ý cần cài đặt Nano Text Editor trước bằng lệnh</li>
</ul>



<pre class="wp-block-code"><code>sudo apt-get install nano

sudo nano /etc/php/7.2/apache2/php.ini</code></pre>



<ul class="wp-block-list">
<li>Thay đổi các thông số cấu hình cho phù hợp. Để làm nhanh, trên terminal Linix, các bạn nhấn Ctrl W, copy từng dòng text ở dưới, dán vào Terminal (Click chuột phải để dán), để tìm kiếm nhanh đến nơi cần chỉnh sửa</li>
</ul>



<pre class="wp-block-code"><code>file_uploads = On

allow_url_fopen = On

short_open_tag = On

memory_limit = 256M

upload_max_filesize = 100M

max_execution_time = 360

max_input_vars = 1500

date.timezone = Ho Chi Minh</code></pre>



<ul class="wp-block-list">
<li>Nhấn Ctrl O, Enter, để lưu lại. Nhấn Ctrl X để thoát ra</li>



<li>Để kiểm tra cài đặt PHP 7.2 với Apache2, hãy tạo tệp phpinfo.php trong thư mục gốc Apache2 bằng cách chạy các lệnh bên dưới</li>
</ul>



<pre class="wp-block-code"><code>sudo nano /var/www/html/phpinfo.php</code></pre>



<ul class="wp-block-list">
<li>Copy đoạn text dưới, dán vào, và lưu lại bằng cách CTRL O, Enter, CTRL X để thoát ra</li>
</ul>



<h5 class="wp-block-heading">Tạo database cho SnipeIT</h5>



<ul class="wp-block-list">
<li>Chạy các lệnh bên dưới để đăng nhập vào MariaDB. Khi được nhắc nhập mật khẩu, hãy nhập mật khẩu root bạn đã tạo ở trên.</li>
</ul>



<pre class="wp-block-code"><code>sudo mysql -u root -p</code></pre>



<ul class="wp-block-list">
<li>Tạo database tên snipeit</li>
</ul>



<pre class="wp-block-code"><code>CREATE DATABASE snipeit;</code></pre>



<ul class="wp-block-list">
<li>Tạo user truy cập vào database SnipeIT với mật khẩu mới</li>
</ul>



<pre class="wp-block-code"><code>CREATE USER '<strong>snipeituser</strong>'@'<strong>localhost</strong>' IDENTIFIED BY '<strong>nhập mật khẩu mới ở đây</strong>';</code></pre>



<ul class="wp-block-list">
<li>Cấp cho user toàn quyền truy cập vào SnipeIT database</li>
</ul>



<pre class="wp-block-code"><code>GRANT ALL ON snipeit.* TO 'snipeituser'@'localhost' WITH GRANT OPTION;</code></pre>



<ul class="wp-block-list">
<li>Lưu lại và thoát ra</li>
</ul>



<pre class="wp-block-code"><code>FLUSH PRIVILEGES;

EXIT;</code></pre>



<h5 class="wp-block-heading">Tải về SnipeIT bản mới nhất</h5>



<ul class="wp-block-list">
<li>Bạn sẽ dowload bản SnipeIT mới nhất từ kho lưu trữ Github. Bạn cần cài đặt trước Composer và Curl</li>
</ul>



<pre class="wp-block-code"><code>sudo apt install curl git

sudo apt install composer

curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=compose</code></pre>



<p class="wp-block-paragraph">Dowload SnipeIT</p>



<pre class="wp-block-preformatted">cd /var/www/<br><br>sudo git clone https://github.com/snipe/snipe-it snipeit<br><br>sudo cp /var/www/snipeit/.env.example /var/www/snipeit/.env</pre>



<ul class="wp-block-list">
<li>Chỉnh sửa file .env vừa tạo trên để thiết lập cấu hình cho SnipeIT</li>
</ul>



<pre class="wp-block-code"><code>sudo nano /var/www/snipeit/.env</code></pre>



<ul class="wp-block-list">
<li>Copy đoạn code dưới, dán vào file .env. Chỉnh sửa lại APP_URL, DB_DATABASE, DB_USERNAME, DB_PASSWORD.</li>



<li>Tại mục APP_URL bạn có thể gán địa chỉ IP WAN public ( truy cập để xem IP WAN: https://www.canyouseeme.org/), hoặc tên miền của bạn (tên miền cần mua)</li>
</ul>



<pre class="wp-block-code"><code># --------------------------------------------

# REQUIRED: BASIC APP SETTINGS

# --------------------------------------------

APP_ENV=production

APP_DEBUG=false

APP_KEY=ChangeMe

APP_URL=example.com

APP_TIMEZONE='UTC'

APP_LOCALE=en

MAX_RESULTS=500

# --------------------------------------------

# REQUIRED: DATABASE SETTINGS

# --------------------------------------------

DB_CONNECTION=mysql

DB_HOST=127.0.0.1

DB_DATABASE=snipeit

DB_USERNAME=snipeituser

DB_PASSWORD=type_password_here

DB_PREFIX=null

DB_DUMP_PATH='/usr/bin'

DB_CHARSET=utf8mb4

DB_COLLATION=utf8mb4_unicode_ci

# --------------------------------------------

# OPTIONAL: SSL DATABASE SETTINGS</code></pre>



<ul class="wp-block-list">
<li>Nhấn tổ hợp phím Ctrl O, nhấn Enter để lưu lại. Nhấn Ctrl X để thoát ra</li>



<li>Gõ lệnh cd để quay về màn hình chủ root. Sau đó cập nhật tất cả các gói dữ liệu bằng Composer</li>
</ul>



<pre class="wp-block-code"><code>cd /var/www/snipeit

sudo composer install --no-dev --prefer-source</code></pre>



<ul class="wp-block-list">
<li>Chờ đợi 1 lúc, sau đó chạy lệnh dưới, nhấn yes</li>
</ul>



<pre class="wp-block-code"><code>sudo php artisan key:generate</code></pre>



<ul class="wp-block-list">
<li>Hiện thị ra một dãy mã</li>
</ul>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="758" height="262" src="https://blntech.io.vn/wp-content/uploads/2025/07/image-300.png" alt="" class="wp-image-5450" srcset="https://blntech.io.vn/wp-content/uploads/2025/07/image-300.png 758w, https://blntech.io.vn/wp-content/uploads/2025/07/image-300-300x104.png 300w" sizes="auto, (max-width: 758px) 100vw, 758px" /></figure>



<ul class="wp-block-list">
<li>Vì bạn vừa chạy máy chủ web dưới dạng root, bạn nên đảm bảo mọi tệp mới được tạo đều thuộc sở hữu của người dùng và nhóm www-data.</li>
</ul>



<pre class="wp-block-code"><code>cd

sudo chown -R www-data:www-data /var/www/snipeit/

sudo chmod -R 755 /var/www/snipeit/</code></pre>



<h5 class="wp-block-heading">Cấu hình Apache2</h5>



<ul class="wp-block-list">
<li>Tạo 1 file cấu hình truy cập SnipeIT trong Apache2</li>
</ul>



<pre class="wp-block-code"><code>sudo nano /etc/apache2/sites-available/snipeit.conf</code></pre>



<ul class="wp-block-list">
<li>Sau đó copy và dán những lệnh dưới vào.</li>



<li>Tại mục ServerName bạn có thể gán địa chỉ IP WAN public ( truy cập để xem IP WAN: https://www.canyouseeme.org/), hoặc tên miền của bạn (tên miền cần mua)</li>
</ul>



<pre class="wp-block-preformatted">&lt;VirtualHost *:80><br><br>ServerAdmin [admin@example.com]<br><br>DocumentRoot /var/www/snipeit/public<br><br>ServerName example.com<br><br>ServerAlias www.example.com<br><br>&lt;Directory /var/www/snipeit/public/><br><br>Options +FollowSymlinks<br><br>AllowOverride All<br><br>Require all granted<br><br>&lt;/Directory><br><br>ErrorLog ${APACHE_LOG_DIR}/error.log<br><br>CustomLog ${APACHE_LOG_DIR}/access.log combined<br><br>&lt;/VirtualHost></pre>



<ul class="wp-block-list">
<li>Lưu lại bằng cách Ctrl O, Enter, Ctrl X để thoát ra</li>
</ul>



<h5 class="wp-block-heading">Khởi động SnipeIT lên</h5>



<ul class="wp-block-list">
<li>Chạy các lệnh sau, khởi động lại dịch vụ apache2</li>
</ul>



<pre class="wp-block-code"><code>sudo a2ensite snipeit.conf

sudo a2enmod rewrite

sudo systemctl restart apache2.service</code></pre>



<ul class="wp-block-list">
<li>Mở trình duyệt web, nhập địa IP hoặc tên miền, trùng với tên ServerName và ServerAlias mà bạn đã cấu hình trong file <strong>/etc/apache2/sites-available/snipeit.conf</strong> mà bạn đã nhập ở bước trên. Hiện lên giao diện như hình</li>
</ul>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="659" height="542" src="https://blntech.io.vn/wp-content/uploads/2025/07/image-301.png" alt="" class="wp-image-5451" srcset="https://blntech.io.vn/wp-content/uploads/2025/07/image-301.png 659w, https://blntech.io.vn/wp-content/uploads/2025/07/image-301-300x247.png 300w" sizes="auto, (max-width: 659px) 100vw, 659px" /></figure>



<ul class="wp-block-list">
<li>Tạo tài khoản admin để quản lý và đăng nhập vào SnipeIT</li>



<li>Đặt tên cho Site của bạn.</li>
</ul>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="662" height="454" src="https://blntech.io.vn/wp-content/uploads/2025/07/image-302.png" alt="" class="wp-image-5452" srcset="https://blntech.io.vn/wp-content/uploads/2025/07/image-302.png 662w, https://blntech.io.vn/wp-content/uploads/2025/07/image-302-300x206.png 300w" sizes="auto, (max-width: 662px) 100vw, 662px" /></figure>



<ul class="wp-block-list">
<li>Thành quả của bạn sẽ như hình. Vậy là các bạn đã cài xong phần mềm mở SnipeIT dùng để quản lý thiết bị hiệu quả.</li>
</ul>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="750" height="428" src="https://blntech.io.vn/wp-content/uploads/2025/07/image-303.png" alt="" class="wp-image-5453" srcset="https://blntech.io.vn/wp-content/uploads/2025/07/image-303.png 750w, https://blntech.io.vn/wp-content/uploads/2025/07/image-303-300x171.png 300w" sizes="auto, (max-width: 750px) 100vw, 750px" /></figure>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p class="wp-block-paragraph">Nguồn bài viết: ITForVN<br>Nguồn tham khảo: https://websiteforstudents.com/install-snipe-it-on-ubuntu-18-04-18-04-with-apache2/</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Giới thiệu tổng quan về nagios core</title>
		<link>https://blntech.io.vn/gioi-thieu-tong-quan-ve-nagios-core/</link>
		
		<dc:creator><![CDATA[nhanvph]]></dc:creator>
		<pubDate>Thu, 17 Jul 2025 04:39:37 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Monitor]]></category>
		<category><![CDATA[Nagios]]></category>
		<category><![CDATA[Seri Nagios]]></category>
		<guid isPermaLink="false">https://blntech.io.vn/?p=2085</guid>

					<description><![CDATA[Giám sát thiết bị là một vấn đề cần thiết trong mỗi một hệ thống. Để có thể biết rằng [&#8230;]]]></description>
										<content:encoded><![CDATA[
<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p class="wp-block-paragraph">Giám sát thiết bị là một vấn đề cần thiết trong mỗi một hệ thống. Để có thể biết rằng hoạt động của hệ thống có được tốt hay không thì nagios core là một giải pháp giúp ta giám sát những việc đó</p>
</blockquote>



<h2 class="wp-block-heading">Khái niệm</h2>



<p class="wp-block-paragraph">Nagios core là một phần mềm mã nguồn mở và giám sát mạng. Nó sẽ theo dõi hệ thống, dịch vụ mạng và sẽ cảnh báo khi mà có sự cố xảy ra với những gì nó theo dõi. Như là CPU chạy quá tải hay một host bị hỏng không còn hoạt động, dịch vụ ssh bị lỗi….</p>



<p class="wp-block-paragraph">Nagios core được phát hành từ năm 1999 bởi Ethan Galstad, và lúc đó nó có cái tên là&nbsp;<strong>Nestaint</strong>. Đến năm 2002 được đổi tên thành&nbsp;<strong>Nagios</strong>&nbsp;và năm 2009 nó đã chính thức có tên là&nbsp;<strong>Nagios core</strong></p>



<p class="wp-block-paragraph">Một số chức năng nagios cung cấp</p>



<ul class="wp-block-list">
<li>Giám sát tài nguyên máy chủ</li>



<li>Giám sát dịch vụ mạng</li>



<li>Giám sát phần cứng</li>



<li>Giám sát từ xa</li>



<li>Cung cấp phương thức cảnh báo khi gặp sự cố</li>



<li>etc…</li>
</ul>



<h2 class="wp-block-heading">Các Khái niệm trong nagios core</h2>



<h4 class="wp-block-heading">1. Plugins</h4>



<ul class="wp-block-list">
<li>Là một lớp trừ tượng ở giữa nagios server và host hay service</li>



<li>Là một dòng lệnh hay có thể là một đoạn script</li>



<li>Plugins có chức năng kiểm tra host và service rồi trả lại kết quả cho nagios server</li>
</ul>



<h4 class="wp-block-heading">2. Web server</h4>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="531" height="348" src="https://blntech.io.vn/wp-content/uploads/2025/07/image-8.png" alt="" class="wp-image-2319" srcset="https://blntech.io.vn/wp-content/uploads/2025/07/image-8.png 531w, https://blntech.io.vn/wp-content/uploads/2025/07/image-8-300x197.png 300w" sizes="auto, (max-width: 531px) 100vw, 531px" /></figure>



<ul class="wp-block-list">
<li>Là nơi lưu trữ các file, các thành phần của website ( file html, css, ảnh…)</li>



<li>Là nơi cung cấp dữ liệu của website cho người dùng muốn truy cập và sử dụng. Nó sẽ cung cấp dữ liệu cho người dùng thông qua internet</li>
</ul>



<h4 class="wp-block-heading">3. DATABASE (DB)</h4>



<ul class="wp-block-list">
<li>DB bao gồm DATA và DBMS</li>



<li>DATA : Là loại dữ liệu của nagios server. Dữ liệu này là thông tin của các client sau khi được kiểm tra</li>



<li>DBMS là hệ quản trị cơ sở dữ liệu. Được thiết kế nhằm mục đích quản lý dữ liệu dễ dàng hơn, bảo mật cao hơn. Theo mặc định thì&nbsp;<strong>DATA</strong>&nbsp;của nagios server sẽ được lưu trữ trong file nhưng có thể lưu trữ nó ở trong một hệ quản trị cơ sở dữ liệu</li>



<li>Trên DB người dùng sẽ dễ dàng thao tác với dữ liệu được lưu trữ trong file</li>



<li>Trong nagios có hỗ trợ 2 DB là&nbsp;<strong>mysql</strong>&nbsp;và&nbsp;<strong>postgreSQL</strong></li>
</ul>



<h4 class="wp-block-heading">4. &nbsp;CGI (Common Gateway Interface)</h4>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="633" height="261" src="https://blntech.io.vn/wp-content/uploads/2025/07/image-9.png" alt="" class="wp-image-2320" srcset="https://blntech.io.vn/wp-content/uploads/2025/07/image-9.png 633w, https://blntech.io.vn/wp-content/uploads/2025/07/image-9-300x124.png 300w" sizes="auto, (max-width: 633px) 100vw, 633px" /></figure>



<ul class="wp-block-list">
<li>CGI hay còn được gọi là giao diện dòng lệnh nó cung cấp giao thức để web server sử dụng</li>



<li>Web server thường gửi thông tin biểu mẫu cho một quy trình xử lý dữ liệu và có thể gửi lại thông báo xác nhận . Quá trình đó được gọi là CGI</li>



<li>CGI có thể được viết nên từ ngôn ngữ nào đó như : C, perl, shell…</li>
</ul>



<h2 class="wp-block-heading">Ưu điểm và nhược điểm của nagios core</h2>



<h4 class="wp-block-heading">Ưu điểm</h4>



<ul class="wp-block-list">
<li>Là một phần mềm mã nguồn mở và miễn phí</li>



<li>Giám sát tập trung</li>



<li>Có thể tích hợp được nhiều ngôn ngữ khác nhau</li>



<li>Có một cộng đồng phát triển plugins lớn, vì vậy có rất nhiều các plugins đã có sẵn</li>
</ul>



<h4 class="wp-block-heading">Nhược điểm</h4>



<ul class="wp-block-list">
<li>Giao diện đồ họa lâu đời</li>



<li>Không có khả năng tự phát hiện host khi được thêm vào. Người quản trị sẽ phải cấu hình thủ công tất cả các host và các service. Việc này ảnh hưởng đến khả năng mở rộng quy mô khó khăn</li>
</ul>



<h2 class="wp-block-heading">Luồng hoạt động của nagios core</h2>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="691" height="311" src="https://blntech.io.vn/wp-content/uploads/2025/07/image-10.png" alt="" class="wp-image-2321" srcset="https://blntech.io.vn/wp-content/uploads/2025/07/image-10.png 691w, https://blntech.io.vn/wp-content/uploads/2025/07/image-10-300x135.png 300w" sizes="auto, (max-width: 691px) 100vw, 691px" /></figure>



<ul class="wp-block-list">
<li>Bước 1: Client sẽ sử dụng giao thức http để tạo yêu cầu thông tin website cho nagios server</li>



<li>Bước 2: Web server sẽ sử dụng CGI để lấy thông tin từ nagios server</li>



<li>Bước 3: Nagios server sẽ xem lại file cache. Nếu trong đó có thông tin mà client yêu cầu thì nó sẽ lập tức trả lại kết quả. Nếu không có nagios sẽ tạo ra một plugins để kiểm tra lại thông tin mà client yêu cầu</li>



<li>Bước 4: Plugins sẽ check thông tin theo yêu cầu và sau đó trả lại thông tin lại cho nagios server</li>



<li>Bước 5: Sau khi được nhận thông tin từ plugins thì nagios server sẽ lưu trữ thông tin đó vào một file hoặc một DB do cài đặt của người quản trị. Và đồng thời nó sẽ lưu trữ thông tin này vào file cache nếu người quản trị có sử dụng chức năng của file này</li>



<li>Bước 6: Nagios sẽ xác định những việc phải làm dựa trên thông tin được trả về từ nagios. Có cần cảnh báo hay không và đánh giá trạng thái của các host hay service. Rồi sau đó trả lại thông tin cho webserver</li>



<li>Bước 7: Web server sẽ sử dụng lại giao thức http trả lại thông tin mà client yêu cầu.</li>
</ul>



<p class="wp-block-paragraph"><em>Bên trên là một bài giới thiệu tổng quan về nagios. Vậy thì cách cài đặt của nó ra sao và làm thế nào để tạo ra một nagios server dành cho riêng mình. Bạn hãy tham khảo ở bài&nbsp;cài đặt nagios 4.x trên centos7</em></p>



<p class="wp-block-paragraph">Nguồn: cloud365.vn</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Kết nối máy chủ bằng SSH trên Ubuntu</title>
		<link>https://blntech.io.vn/ket-noi-may-chu-bang-ssh-tren-ubuntu/</link>
		
		<dc:creator><![CDATA[nhanvph]]></dc:creator>
		<pubDate>Thu, 17 Jul 2025 04:08:38 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<guid isPermaLink="false">https://blntech.io.vn/?p=2262</guid>

					<description><![CDATA[Để có thể điều khiển từ xa một máy chủ, người ta thường sử dụng giao thức SSH. Bài viết [&#8230;]]]></description>
										<content:encoded><![CDATA[
<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p class="wp-block-paragraph">Để có thể điều khiển từ xa một máy chủ, người ta thường sử dụng giao thức SSH. Bài viết này sẽ tìm hiểu cũng như hướng dẫn bạn cách kết nối với máy chủ thông qua giao thức SSH.</p>
</blockquote>



<ol class="wp-block-list"></ol>



<h3 class="wp-block-heading" id="1.Tổng-quan-về-SSH">1. Tổng quan về SSH</h3>



<p class="wp-block-paragraph">SSH (hay Secure Shell) là một giao thức mạng được mã hoá để vận hành các dịch vụ mạng một cách an toàn. Giao thức này cung cấp một kênh kết nối bảo mật trong mô hình kết nối client-server. SSH sử dụng cổng TCP tiêu chuẩn là 22. Việc sử dụng giao thức SSH để kết nối sẽ tránh được các rủi ro trong việc nghe lén và đánh cắp thông tin.</p>



<p class="wp-block-paragraph">Để thực hiện kết nối SSH, bạn có thể làm một vài cách như sau:</p>



<ul class="wp-block-list">
<li>Sử dụng mật khẩu để xác thực.</li>



<li>Sử dụng cơ chế Key pairs</li>
</ul>



<h2 class="wp-block-heading" id="2m%C3%B4-h%C3%ACnh-k%E1%BA%BFt-n%E1%BB%91i-ssh">2. Mô hình kết nối SSH</h2>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="731" height="361" src="https://blntech.io.vn/wp-content/uploads/2025/07/image.png" alt="" class="wp-image-2307" srcset="https://blntech.io.vn/wp-content/uploads/2025/07/image.png 731w, https://blntech.io.vn/wp-content/uploads/2025/07/image-300x148.png 300w" sizes="auto, (max-width: 731px) 100vw, 731px" /></figure>



<p class="wp-block-paragraph">Trong bài này, mình sẽ sử dụng một máy khách dùng Ubuntu với user root để kết nối với máy chủ có địa chỉ là&nbsp;<code>172.16.2.160</code>.</p>



<p class="wp-block-paragraph">Về cơ bản, để thực hiện được kết nối này, bạn phải đảm bảo chắc chắn máy tính của bạn phải kết nối được với máy chủ. Để kiểm tra, bạn mở Terminal và gõ:</p>



<pre class="wp-block-code"><code>ping &lt;địa chỉ ip&gt;</code></pre>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="735" height="521" src="https://blntech.io.vn/wp-content/uploads/2025/07/image-1.png" alt="" class="wp-image-2308" srcset="https://blntech.io.vn/wp-content/uploads/2025/07/image-1.png 735w, https://blntech.io.vn/wp-content/uploads/2025/07/image-1-300x213.png 300w" sizes="auto, (max-width: 735px) 100vw, 735px" /></figure>



<p class="wp-block-paragraph">Khi đã có kết nối, chúng ta sẽ tiến hành kết nối với máy chủ.</p>



<h2 class="wp-block-heading" id="3th%E1%BB%B1c-hi%E1%BB%87n-ssh-b%E1%BA%B1ng-m%E1%BA%ADt-kh%E1%BA%A9u">3. Thực hiện SSH bằng mật khẩu</h2>



<p class="wp-block-paragraph">Với cách này, bạn cần nắm được mật khẩu đăng nhập người dùng trên máy chủ. Để thực hiện, bạn gõ trên Terminal như sau:</p>



<pre class="wp-block-code"><code>ssh &lt;người dùng&gt;@&lt;địa chỉ ip&gt;</code></pre>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="735" height="518" src="https://blntech.io.vn/wp-content/uploads/2025/07/image-2.png" alt="" class="wp-image-2309" srcset="https://blntech.io.vn/wp-content/uploads/2025/07/image-2.png 735w, https://blntech.io.vn/wp-content/uploads/2025/07/image-2-300x211.png 300w" sizes="auto, (max-width: 735px) 100vw, 735px" /></figure>



<p class="wp-block-paragraph">Nếu là lần kết nối đầu tiên, thì máy sẽ hỏi lại bạn có muốn tiếp tục hay không. Bạn chỉ cần gõ&nbsp;<strong>YES</strong>, sau đó nhập pass. Như vậy, bạn đã thục hiện xong việc kết nối.</p>



<h2 class="wp-block-heading" id="4th%E1%BB%B1c-hi%E1%BB%87n-ssh-b%E1%BA%B1ng-c%C6%A1-ch%E1%BA%BF-key-pairs">4. Thực hiện SSH bằng cơ chế key pairs</h2>



<p class="wp-block-paragraph">Đôi khi việc sử dụng password để đăng nhập sẽ khiến bạn mất công nhớ mật khẩu và tiềm ẩn khả năng bị tấn công cao. Vì vậy, bạn có thể thực hiện việc kết nối thông qua sử dụng cơ chế key pairs.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="731" height="361" src="https://blntech.io.vn/wp-content/uploads/2025/07/image-3.png" alt="" class="wp-image-2310" srcset="https://blntech.io.vn/wp-content/uploads/2025/07/image-3.png 731w, https://blntech.io.vn/wp-content/uploads/2025/07/image-3-300x148.png 300w" sizes="auto, (max-width: 731px) 100vw, 731px" /></figure>



<p class="wp-block-paragraph">Cơ bản thì ở máy khách sẽ tiến hành tạo cặp key là private key và public key, sau đó sẽ gửi key public tới máy chủ và giữ lại private key. Khi muốn thực hiện đăng nhập từ xa, máy khách sẽ gửi yêu cầu kèm key private tới máy chủ. Máy chủ sẽ tiến hành kiểm tra private key có trùng với public Key không. Nếu có thì sẽ đăng nhập thành công.</p>



<h3 class="wp-block-heading" id="b%C6%B0%E1%BB%9Bc-1-t%E1%BA%A1o-key-pairs">Bước 1: Tạo key pairs</h3>



<p class="wp-block-paragraph">Đầu tiên, bạn phải tiến hành tạo SSH key trên máy của mình. Ở đây mình sẽ tạo key trên máy Ubuntu. Trên Terminal, bạn gõ:</p>



<pre class="wp-block-code"><code>ssh-keygen</code></pre>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="736" height="520" src="https://blntech.io.vn/wp-content/uploads/2025/07/image-4.png" alt="" class="wp-image-2311" srcset="https://blntech.io.vn/wp-content/uploads/2025/07/image-4.png 736w, https://blntech.io.vn/wp-content/uploads/2025/07/image-4-300x212.png 300w" sizes="auto, (max-width: 736px) 100vw, 736px" /></figure>



<p class="wp-block-paragraph">Lập tức trên terminal xuất hiện một số yêu cầu sau:</p>



<pre class="wp-block-code"><code>Enter file in which to save the key (/root/.ssh/id_rsa): </code></pre>



<p class="wp-block-paragraph">Bạn sẽ điền tên của file key. Thư mục lưu trữ file key đó là thư mục&nbsp;<code>/root/.ssh/</code>. Nếu bạn không nhập bất cứ gì, tên file sẽ mặc định là&nbsp;<strong>id_rsa</strong>.</p>



<pre class="wp-block-code"><code>Enter passphrase (empty for no passphrase): 
Enter same passphrase again: </code></pre>



<p class="wp-block-paragraph">Tiếp theo là mật khẩu cho key. Bước này sẽ khiến bạn phải xác thực lại key bằng mật khẩu. Nếu không muốn nhập mật khẩu, nhấn Enter để bỏ qua.</p>



<p class="wp-block-paragraph">Như vậy, bạn đã tạo xong key trên máy của mình. Bây giờ thì tiến hành gửi key public tới máy chủ.</p>



<h3 class="wp-block-heading" id="b%C6%B0%E1%BB%9Bc-2-g%E1%BB%ADi-key-public">Bước 2: Gửi key public</h3>



<p class="wp-block-paragraph">Nói chung bước này khá là nhiều bước tuy nhiên có một cách khá đơn giản để thực hiện một mớ các thao tác này đó là sử dụng tiện ích&nbsp;<strong>ssh-copy-id</strong>.</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p class="wp-block-paragraph">Ngoài ra nếu bạn không muốn sử dụng tiện ích này thì cũng có thể thực hiện một số cách khác như sao chép key qua SSH bằng mật khẩu hay sao chép thủ công.</p>
</blockquote>



<p class="wp-block-paragraph">Đầu tiên, trên cửa sổ Terminal, gõ lệnh:</p>



<pre class="wp-block-code"><code>ssh-copy-id &lt;người dùng&gt;@&lt;địa chỉ ip&gt;</code></pre>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="737" height="520" src="https://blntech.io.vn/wp-content/uploads/2025/07/image-5.png" alt="" class="wp-image-2312" srcset="https://blntech.io.vn/wp-content/uploads/2025/07/image-5.png 737w, https://blntech.io.vn/wp-content/uploads/2025/07/image-5-300x212.png 300w" sizes="auto, (max-width: 737px) 100vw, 737px" /></figure>



<p class="wp-block-paragraph">Trên Terminal sẽ hiện một loạt các dòng lệnh, trong đó có các yêu cầu sau.</p>



<pre class="wp-block-code"><code>Are you sure you want to continue connecting (yes/no)?</code></pre>



<p class="wp-block-paragraph">Máy yêu cầu cần xác thực bạn có muốn tiếp tục kết nối hay không. Bạn chỉ cần gõ&nbsp;<strong>YES</strong>.</p>



<pre class="wp-block-code"><code>root@172.16.2.160's password: </code></pre>



<p class="wp-block-paragraph">Tiếp tục, máy yêu cầu bạn nhập mật khẩu cho máy nhận public key (máy chủ), nhập mật khẩu vào là bạn đã hoàn thành xong việc gửi public key tới máy nhận.</p>



<p class="wp-block-paragraph">Bây giờ, trên cửa sổ Terminal của máy khách, gõ lệnh:</p>



<pre class="wp-block-code"><code>ssh &lt;người dùng&gt;@&lt;địa chỉ ip&gt;</code></pre>



<p class="wp-block-paragraph">Như vậy là bạn đã hoàn toàn đăng nhập vào máy server mà không cần nhập mật khẩu.</p>



<h3 class="wp-block-heading" id="gi%E1%BA%A3i-th%C3%ADch-b%C6%B0%E1%BB%9Bc-2">* Giải thích bước 2</h3>



<p class="wp-block-paragraph">Sau khi thực hiện copy và ssh thành công, trên máy server 2 sẽ có một số thay đổi như sau.</p>



<p class="wp-block-paragraph">Đầu tiên, trên terminal của máy chủ (hoặc máy khách đã SSH) gõ:</p>



<pre class="wp-block-code"><code>cd /root
ll -a</code></pre>



<p class="wp-block-paragraph">Terminal sẽ hiện lên như sau:</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="734" height="517" src="https://blntech.io.vn/wp-content/uploads/2025/07/image-6.png" alt="" class="wp-image-2313" srcset="https://blntech.io.vn/wp-content/uploads/2025/07/image-6.png 734w, https://blntech.io.vn/wp-content/uploads/2025/07/image-6-300x211.png 300w" sizes="auto, (max-width: 734px) 100vw, 734px" /></figure>



<p class="wp-block-paragraph">Bạn có thể thấy có 1 thư mục tên là&nbsp;<code>.ssh</code>&nbsp;được tạo ra được cấp quyền là 700 (ý nghĩa con số 700 xem ở&nbsp;<a href="https://en.wikipedia.org/wiki/Chmod#Numerical_permissions">đây</a>).</p>



<p class="wp-block-paragraph">Di chuyển tới thư mục&nbsp;<code>.ssh</code>:</p>



<pre class="wp-block-code"><code>cd .ssh
ll</code></pre>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="734" height="517" src="https://blntech.io.vn/wp-content/uploads/2025/07/image-7.png" alt="" class="wp-image-2314" srcset="https://blntech.io.vn/wp-content/uploads/2025/07/image-7.png 734w, https://blntech.io.vn/wp-content/uploads/2025/07/image-7-300x211.png 300w" sizes="auto, (max-width: 734px) 100vw, 734px" /></figure>



<p class="wp-block-paragraph">Ta thấy có 2 file ở trong thư mục này với các chức năng sau:</p>



<ul class="wp-block-list">
<li>authorized_keys: được cấp quyền 600, lưu trữ thông tin về key public được gửi.</li>



<li>known_hosts: cấp quyền 644, lưu trữ thông tin nhưng máy đã từng đăng nhập bằng SSH.</li>
</ul>



<p class="wp-block-paragraph">Như vậy, ta có thể thấy, tiện ích&nbsp;<strong>ssh-copy-id</strong>&nbsp;đã giúp thực hiện một mớ các thao tác phức tạp về lại một câu lệnh đơn giản và tiện lợi.</p>



<h3 class="wp-block-heading" id="5m%E1%BB%99t-s%E1%BB%91-l%C6%B0u-%C3%BD">5. Một số lưu ý</h3>



<p class="wp-block-paragraph">Nếu tên file key khác với tên mặc định (không phải&nbsp;<strong>id_rsa</strong>) bạn phải thêm cờ&nbsp;<strong>-i</strong>&nbsp;và tên key đó khi thực hiện&nbsp;<strong>ssh-copy-id</strong>. Ví dụ:</p>



<pre class="wp-block-code"><code>ssh-copy-id -i abc.key root@172.16.2.167</code></pre>



<p class="wp-block-paragraph">Khi thực hiện ssh, nếu muốn sử dụng một key khác để đăng nhập, bạn cũng thêm cờ&nbsp;<strong>-i</strong>&nbsp;kèm theo địa chỉ thư mục chứa key, ví dụ như sau:</p>



<pre class="wp-block-code"><code>ssh -i /home/user/abc.key user@172.16.2.167</code></pre>



<p class="wp-block-paragraph">Nếu bạn muốn tắt tính năng đăng nhập bằng mật khẩu, chỉ đăng nhập bằng key pairs. Bạn phải tiến hành tắt tính năng đó trên file config theo các bước sau: Di chuyển đến thư mục chứa file config</p>



<pre class="wp-block-code"><code>cd /etc/ssh/
ls</code></pre>



<p class="wp-block-paragraph">Tìm file sshd_config và sửa nó với vi</p>



<pre class="wp-block-code"><code>vi sshd_config</code></pre>



<p class="wp-block-paragraph">Trong file đó, tìm đến dòng PasswordAuthentication và đổi nó thành&nbsp;<strong>NO</strong>.</p>



<pre class="wp-block-code"><code>...
PasswordAuthentication no
...</code></pre>



<p class="wp-block-paragraph">Sau đó thoát ra ngoài bằng&nbsp;<code>ESC</code>&nbsp;-&gt; gõ&nbsp;<code>:wq</code>&nbsp;(<a href="https://vim.rtorr.com/">tham khảo thêm tài liệu về Vim</a>). Tiến hành restart lại sshd:</p>



<pre class="wp-block-code"><code>sudo systemctl restart sshd.service</code></pre>



<p class="wp-block-paragraph">Nguồn : cloud365.vn</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
