Files
orangepi-rag/markdown/huong-dan-cai-vnc-server-de-remote-orange-pi.md
2026-06-11 23:53:48 +07:00

202 lines
9.5 KiB
Markdown
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
Sau khi cài OS bản có Desktop cho Orange Pi, đôi khi bạn muốn remote trên máy tính luôn để cho tiện hoặc bàn phím / chuột mini quá bé để thao tác. Lúc này bạn có công cụ VNC để hỗ trợ việc này. Sau đây tôi sẽ hướng dẫn bạn cài X11VNC để remote Orange Pi trên máy tính.
Bạn cần :
1 Orange Pi đã cài OS có Desktop, ở đây tôi sử dụng bản Armbian Ubuntu/Debian, demo trên Orange Pi Prime
Một màn hình để Orange Pi chạy start giao diện màn hình, có thể sử dụng màn hình mini của chính Orange PI như demo bên dưới, hoặc sử dụng tivi có HDMI hoặc màn hình máy tính
Tải về trên máy tính phần mềm VNC Viewer, tôi sử dụng VNC Viewer cuar RealVNC https://www.realvnc.com/en/connect/download/viewer/
Ở đây tôi đăng nhập bằng user admin (không phải root) vì khi bắt đầu cài OS, Armbian sẽ yêu cầu bạn tạo 1 tài khoản khác có chức năng sudo để dùng hàng ngày và khởi động giao diện desktop. Bạn có thể tạo bất cứ tên tài khoản nào và mật khẩu, tài khoản này mặc nhiên có chức năng sudo
OK, bắt đầu thôi
Cài X11VNC
`sudo apt-get install x11vnc`
Đặt mật khẩu cho X11VNC, sau này khi dùng VNC Viewer sẽ cần nhập mật khẩu này
`x11vnc -storepasswd`
Bạn sẽ cần VNC Server bật mỗi khi khởi động
`cd ~/.config
mkdir autostart
cd autostart
nano x11vnc.desktop`
Chèn đoạn text sau
> \[Desktop Entry\]
> Encoding=UTF-8
>
> Type=Application
>
> Name=X11VNC
>
> Comment=
>
> Exec=x11vnc -display :0 -forever -shared -o /home/admin/x11vnc.log -bg -rfbauth /home/admin/.vnc/passwd -noshm
>
> StartupNotify=false
>
> Terminal=false
>
> Hidden=false
Bấm Cltr + X để thoát và Y để lưu lại. Reboot để thử lại
Ngoài ra bạn có thể tạo file sh để chạy mỗi khi khởi động
Sửa file rc.local
`sudo nano /etc/rc.local`
Chèn vào câu lệnh sau, ngay trước dòng exit 0
`/bin/sh /home/admin/vnc.sh &
exit 0`
Sau đó tạo 1 file vnc.sh tại thư mục /home/admin của bạn
> #!/bin/bash
>
> sleep 15
>
> x11vnc -display :0 -forever -shared -o /home/admin/x11vnc.log -bg -rfbauth /home/admin/.vnc/passwd -noshm
Thêm quyền chạy cho file vnc.sh :
`
chmod +x /home/admin/vnc.sh`
Nếu bạn đăng nhập dưới account root, quá trình làm không khác trên chỉ có điều câu lệnh khởi động VNC Server phải thay là
`x11vnc -display :0 -forever -shared -o /root/x11vnc.log -bg -rfbauth /root/.vnc/passwd -noshm`
Xem video sau demo
Cài VNC cho Orange Pi - YouTube
Tap to unmute
[Cài VNC cho Orange Pi](https://www.youtube.com/watch?v=k0RT1bsjTGo) [Orange Pi Vietnam](https://www.youtube.com/channel/UCl0lVmXFHAhZybuOIzu2CaA)
![thumbnail-image](https://yt3.ggpht.com/nDus3_aNISkA5x8KD3J1lcxvLAPBa0WdYl8UDthVlh1HXRK1WyCmMfqfbq6lqd3hRx8iqHc6ysA=s68-c-k-c0x00ffffff-no-rj)
Orange Pi Vietnam1.83K subscribers
[Watch on](https://www.youtube.com/watch?v=k0RT1bsjTGo)
[Chia sẻ trên WhatsApp](whatsapp://send?text=H%C6%B0%E1%BB%9Bng%20d%E1%BA%ABn%20c%C3%A0i%20VNC%20Server%20%C4%91%E1%BB%83%20remote%20Orange%20Pi%20-%20https://orangepi.vn/huong-dan-cai-vnc-server-de-remote-orange-pi.html "Chia sẻ trên WhatsApp")[Chia sẻ trên Facebook](https://www.facebook.com/sharer.php?u=https://orangepi.vn/huong-dan-cai-vnc-server-de-remote-orange-pi.html "Chia sẻ trên Facebook")[Chia sẻ trên Twitter](https://twitter.com/share?url=https://orangepi.vn/huong-dan-cai-vnc-server-de-remote-orange-pi.html "Chia sẻ trên Twitter")[Gửi email cho bạn bè](mailto:?subject=H%C6%B0%E1%BB%9Bng%20d%E1%BA%ABn%20c%C3%A0i%20VNC%20Server%20%C4%91%E1%BB%83%20remote%20Orange%20Pi&body=Xem%20n%C3%A0y%3A%20https%3A%2F%2Forangepi.vn%2Fhuong-dan-cai-vnc-server-de-remote-orange-pi.html "Gửi email cho bạn bè")[Ghim trên Pinterest](https://pinterest.com/pin/create/button?url=https://orangepi.vn/huong-dan-cai-vnc-server-de-remote-orange-pi.html&media&description=H%C6%B0%E1%BB%9Bng%20d%E1%BA%ABn%20c%C3%A0i%20VNC%20Server%20%C4%91%E1%BB%83%20remote%20Orange%20Pi "Ghim trên Pinterest")[Chia sẻ trên LinkedIn](https://www.linkedin.com/shareArticle?mini=true&url=https://orangepi.vn/huong-dan-cai-vnc-server-de-remote-orange-pi.html&title=H%C6%B0%E1%BB%9Bng%20d%E1%BA%ABn%20c%C3%A0i%20VNC%20Server%20%C4%91%E1%BB%83%20remote%20Orange%20Pi "Chia sẻ trên LinkedIn")
![](https://secure.gravatar.com/avatar/fedf9d992f1e8a3e3109ac596191d91386f32fb01a7f6a91e35636c5eefb761e?s=90&d=mm&r=g)
##### superadmin
### 2 bình luận về “Hướng dẫn cài VNC Server để remote Orange Pi”
1. ![](https://secure.gravatar.com/avatar/b7abdce212f681548b6758eacba0e7f916581a9bd83f4fed03b85f8634675d85?s=70&d=mm&r=g)
Việt Anhcho biết:
Xin hỏi nếu tôi muốn X11VNC chạy cùng với login screen thì phải làm thế nào?
Nghĩa là khi khởi động máy pi lên, tại màn hình đăng nhập mình vẫn có thể kết nối đến VNC Server, nhập mật khẩu đăng nhập và bắt đầu remote. Xin cảm ơn!
[30 Tháng 5, 2022 lúc 3:57 chiều](https://orangepi.vn/huong-dan-cai-vnc-server-de-remote-orange-pi.html#comment-3389)
[Trả lời](https://orangepi.vn/huong-dan-cai-vnc-server-de-remote-orange-pi.html#comment-3389)
2. Pingback: [Sử dụng NoMachine để remote desktop Orange Pi - Orange Pi Viet Nam](https://orangepi.vn/su-dung-nomachine-de-remote-desktop-orange-pi.html)
### Để lại một bình luận [Hủy](https://orangepi.vn/huong-dan-cai-vnc-server-de-remote-orange-pi.html\#respond)
Email của bạn sẽ không được hiển thị công khai.Các trường bắt buộc được đánh dấu \*
Bình luận \*
Tên \*
Email \*
Trang web
Δ
- Tìm kiếm:
- [![](https://orangepivn.b-cdn.net/wp-content/uploads/2017/02/cropped-logo-transparent-280x280.png)Orange Pi Việt Nam](https://orangepi.vn/)
- [Giới thiệu về máy tính nhúng](https://orangepi.vn/gioi-thieu-ve-may-tinh-nhung)
- [Hướng dẫn đặt hàng](https://orangepi.vn/dat-hang-tai-orange-pi-viet-nam)
- [Chính sách Bảo hành](https://orangepi.vn/chinh-sach-ban-hang-va-bao-hanh)
- [Thư ủy quyền phân phối tại Việt Nam](https://orangepi.vn/thu-uy-quyen-phan-phoi-tai-viet-nam)
- [Chính sách bảo mật](https://orangepi.vn/chinh-sach-bao-mat)
- [Liên hệ](https://orangepi.vn/lien-he)
- [Shop](https://orangepi.vn/shop)
- [Bo Mạch Orange Pi](https://orangepi.vn/danh-muc-san-pham/bo-mach-orange-pi)
- [Chip H3](https://orangepi.vn/tu-khoa-san-pham/chip-h3)
- [Chip H6](https://orangepi.vn/tu-khoa-san-pham/chip-h6)
- [RK3399](https://orangepi.vn/tu-khoa-san-pham/chip-rk3399)
- [RK3588, RK3566](https://orangepi.vn/tu-khoa-san-pham/rk3588)
- [Chip H616, H618](https://orangepi.vn/tu-khoa-san-pham/chip-h616)
- [Allwinner A733](https://orangepi.vn/tu-khoa-san-pham/allwinner-a733)
- [RAM 1GB](https://orangepi.vn/tu-khoa-san-pham/ram-1gb)
- [RAM 2GB](https://orangepi.vn/tu-khoa-san-pham/ram-2gb)
- [RAM 4GB](https://orangepi.vn/tu-khoa-san-pham/ram-4gb)
- [RAM 6GB](https://orangepi.vn/tu-khoa-san-pham/ram-6gb)
- [RAM 8GB](https://orangepi.vn/tu-khoa-san-pham/ram8gb)
- [Phụ kiện Orange Pi](https://orangepi.vn/danh-muc-san-pham/phu-kien-orange-pi)
- [Màn hình](https://orangepi.vn/tu-khoa-san-pham/man-hinh)
- [Vỏ Mica lắp ghép](https://orangepi.vn/tu-khoa-san-pham/vo-mica)
- [Vỏ thép kiêm tản nhiệt](https://orangepi.vn/tu-khoa-san-pham/vo-thep)
- [Vỏ nhôm nhẹ tản nhiệt tốt](https://orangepi.vn/tu-khoa-san-pham/vo-nhom)
- [Nguồn Orange Pi](https://orangepi.vn/tu-khoa-san-pham/nguon-orange-pi)
- [Thẻ nhớ microSD](https://orangepi.vn/tu-khoa-san-pham/the-nho-microsd)
- [Compute Module](https://orangepi.vn/tu-khoa-san-pham/compute-module)
- [Blog](https://orangepi.vn/blog)
- [Giới thiệu](https://orangepi.vn/category/gioi-thieu)
- [Hướng dẫn](https://orangepi.vn/category/huong-dan)
- [Trình diễn](https://orangepi.vn/category/trinh-dien)
- [Đăng nhập](https://orangepi.vn/my-account "Đăng nhập")
- [**Hotline: 0923449899**](tel:0923449899)
Bạn cần trợ giúp?
[![Messenger](https://orangepi.vn/wp-content/plugins/chat-bubble/assets/images/fbmessenger.svg)Messenger](https://m.me/orangepivietnam "Messenger") [![Zalo Official Account](https://orangepi.vn/wp-content/plugins/chat-bubble/assets/images/zalo.svg)Zalo Official Account](https://oa.zalo.me/1687181280533723118 "Zalo Official Account") [![Telegram](https://orangepi.vn/wp-content/plugins/chat-bubble/assets/images/telegram.svg)Telegram](https://t.me/maytinhnhung "Telegram") [![Whatsapp](https://orangepi.vn/wp-content/plugins/chat-bubble/assets/images/whatsapp.svg)Whatsapp](https://api.whatsapp.com/send?phone=84923449899 "Whatsapp")
![Orange Pi Việt Nam](https://orangepivn.b-cdn.net/wp-content/uploads/2017/02/logo-transparent.png)
Orange Pi Việt NamNhà phân phối chính thức
Xin chào! 👋🏼👋🏼👋🏼 Tôi có thể giúp gì được bạn?
- [Hotline](tel:0923449899 "Hotline")
- [Facebook](https://www.facebook.com/orangepivietnam "Facebook")
- [Zalo](https://oa.zalo.me/1687181280533723118 "Zalo")
## Đăng nhập
Sign In - Google Accounts
Continue with GoogleContinue with Google. Opens in new tab
Tên tài khoản hoặc địa chỉ email \*Bắt buộc
Mật khẩu \*Bắt buộc
Ghi nhớ mật khẩuĐăng nhập
[Quên mật khẩu?](https://orangepi.vn/my-account/lost-password)