首先確定把BIOS升級到1.30以上。(可以透過dmidecode查看)
接下來,將系統重新開機後進入BIOS去選擇: (Default設定是Win10)
Config -> Power -> Sleep State -> Set to Linux
到這邊已經完成了,系統測試一切正常!
Operating System: Ubuntu 18.04.2 LTS
Kernel: Linux 4.15.0-46-generic
Architecture: x86-64
Operating System: Ubuntu 18.04.2 LTS
Kernel: Linux 4.15.0-46-generic
Architecture: x86-64
http://releases.ubuntu.com/xenial/
$ sudo apt update && apt install vsftpd
$ systemctl status vsftpd
$ netstat -tupln | grep ftp
$ sudo vi /etc/vsftpd.conf
# Allow anonymous FTP? (Disabled by default).
anonymous_enable=YES
# Uncomment this to enable any form of FTP write command.
write_enable=YES
# Uncomment this to allow the anonymous FTP user to upload files. This only
# has an effect if the above global write enable is activated. Also, you will
# obviously need to create a directory writable by the FTP user.
anon_upload_enable=YES
$ sudo systemctl restart vsftpd
$ cd /srv/ftp
$ sudo mkdir pub
$ sudo chmod 777 pub
$ sudo chown ftp.ftp pub
$ sudo ufw allow from any to any port 20,21 proto tcp
(這邊暫時不考慮FTP PASV mode, 所以只需要開放TCP port 20,21)
透過HWE為現有的Ubuntu LTS版本(Desktop, Server, Cloud)提供了更新的Kernel和X來進一步支援新的硬體。比方說預設18.04 LTS是採用Kernel 4.15,然而透過HWE的機制,使用者可以在18.04 LTS跑Kernel 4.18(18.10預設內核)。
1. 切換到Windows去執行廠商所提供的工具來升級。換句話說,其實對Linux使用者是挺不方便的,所以有人提出了LVFS project這個好主意。
2. 手動抓取相關的firmware然後自行製作開機disk來升級。
https://fwupd.org/users
https://blog.ubuntu.com/2017/06/06/canonical-kernel-livepatch-service-now-available-for-ubuntu-14-04-lts
https://www.ubuntu.com/livepatch
$ sudo apt-get install vnc4server xfce4 xfce4-goodies2. 建立VNC server的配置檔與user密碼:
$ vncpasswd
$ vim.tiny ~/.vnc/xstartup
#!/bin/sh
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
exec startxfce4
$ chmod 755 ~/.vnc/xstartup3. 手動啟動VNC Server:
這個時候我們先測試看看VNC Server可不可以正常工作。
如果有看到以上類似的畫面,那說明VNC Server已經啟動並且listen在TCP port 5901。但是請注意,預設它會只listen在localhost,這個等一下在建立systemd startup script的時候,我們可以修改它。4. 建立systemd startup script:
做這個設定的最大好處是將來系統重開機後,我就不需要每次都要手動啟動VNC Server了。
4.1 建立VNC Server script file:
$ sudo vim.tiny /etc/systemd/system/vncserver@.service
[Unit]
Description=Remote desktop service (VNC)
After=syslog.target network.target
[Service]
Type=simple
User=u
PAMName=login
PIDFile=/home/%u/.vnc/%H%i.pid
ExecStartPre=/bin/sh -c '/usr/bin/vncserver -localhost no -kill :%i > /dev/null 2>&1 || :'
ExecStart=/usr/bin/vncserver :%i -localhost no -geometry 1440x900 -alwaysshared -fg
ExecStop=/usr/bin/vncserver -kill :%i
[Install]
WantedBy=multi-user.target
剛剛有提到預設VNC Server只會listen在localhost:5901,但透過參數-localhost no可以讓它listen在0.0.0.0也就是all net的概念。
4.2 手動reload systemd: (每次有新增或修改systemd的startup script file後,記得此步驟)
$ sudo systemctl daemon-reload
4.3 透過systemd啟動VNC Server:
$ sudo systemctl start vncserver@1.service
4.4 在系統開機時,自動啟動VNC Server:
$ sudo systemctl enable vncserver@1.service
假設一切順利的話,輸入相關的命令後,應該可以看到類似的畫面。
$ sudo apt-get install radvdStep2. Copy example file of radvid.conf from /usr/share/doc/radvd/examples/ to /etc.
$ sudo cp /usr/share/doc/radvd/examples/radvd.conf.example /etc/radvd.conf
根據你的需求,去配置相關的參數,最重要的應該是prefix,更多詳細的參數可以參考man page。
https://www.systutorials.com/docs/linux/man/5-radvd.conf/Step4. Restart radvd
$ sudo systemctl restart radvd; sudo systemctl enable radvd
$ sudo vi /etc/init.d/rc.local
teamviewer passwd ubuntu3. Restart system
$ systemctl status teamviewerd
● teamviewerd.service - TeamViewer remote control daemon
Loaded: loaded (/etc/systemd/system/teamviewerd.service; enabled; vendor preset: enabled)
Active: active (running) since 三 2018-08-15 11:00:14 CST; 1min 25s ago
Process: 1555 ExecStart=/opt/teamviewer/tv_bin/teamviewerd -d (code=exited, status=0/SUCCESS)
Main PID: 1567 (teamviewerd)
CGroup: /system.slice/teamviewerd.service
└─1567 /opt/teamviewer/tv_bin/teamviewerd -d
$ ps aux | grep -i teamviewer
root 1567 0.3 0.3 1181612 12212 ? Sl 11:00 0:00 /opt/teamviewer/tv_bin/teamviewerd -d
u 1890 0.3 2.2 1990224 88556 ? Sl 11:00 0:00 /opt/teamviewer/tv_bin/TeamViewer
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback
auto enp0s3
iface enp0s3 inet static
address 192.168.1.254
netmask 255.255.255.0
pre-up iptables-restore < /etc/iptables.save
$ sudo apt-get install isc-dhcp-server2. TFTP Server
$ sudo apt-get install tftpd-hpa inetutils-inetd3. NFS Server
$ sudo apt-get install nfs-kernel-server配置:
$ sudo vi /etc/dhcp/dhcpd.conf
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.200 192.168.1.253;
option domain-name-servers 8.8.8.8;
option routers 192.168.1.1;
option broadcast-address 192.168.1.255;
default-lease-time 600;
max-lease-time 7200;
next-server 192.168.1.254;
filename "pxelinux.0";
}
$ sudo systemctl restart isc-dhcp-server2. TFTP Server:
$ sudo vi /etc/default/tftpd-hpa
TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/var/lib/tftpboot"TFTP_ADDRESS=":69"
TFTP_OPTIONS="--secure"
RUN_DAEMON="yes"
OPTIONS="-l -s /var/lib/tftpboot"
$ sudo vi /etc/xinetd.conf
tftp dgram udp wait root /usr/sbin/in.tftpd /usr/sbin/in.tftpd -s /var/lib/tftpboot
$ sudo systemctl restart tftpd-hpa3. PXE bootloader:
$ tar -xJf syslinux-6.03.tar.xz
$ cd syslinux-6.03
$ sudo cp bios/core/pxelinux.0 /var/lib/tftpboot
$ sudo cp bios/com32/lib/libcom32.c32 /var/lib/tftpboot
$ sudo cp bios/com32/libutil/libutil.c32 /var/lib/tftpboot
$ sudo cp bios/com32/elflink/ldlinux/ldlinux.c32 /var/lib/tftpboot
$ sudo cp bios/com32/menu/vesamenu.c32 /var/lib/tftpboot
$ mkdir /var/lib/tftpboot/pxelinux.cfg
$ sudo vi /var/lib/tftpboot/
pxelinux.cfg/default
DEFAULT vesamenu.c32* Remember to copy vmlinuz.efi and initrd.lz to the folder /var/lib/tftpboot from Ubuntu ISO.
MENU TITLE Network boot
LABEL ubuntu-mate-16.04.2-desktop-amd64
MENU LABEL ubuntu-mate-16.04.2-desktop-amd64
KERNEL vmlinuz.efi
APPEND initrd=initrd.lz root=/dev/nfs boot=casper netboot=nfs nfsroot=192.168.1.254:/var/nfs/ubuntu_desktop splash --
$ sudo mount -o loop ubuntu-16.04.3-desktop-amd64.iso /mnt/
$ sudo mkdir -p /var/nfs/ubuntu_desktop
$ sudo cp -rf /mnt/* /var/nfs/ubuntu_desktop/
$ sudo vi /etc/exports
/var/nfs/ubuntu_desktop *(ro,sync)
$ sudo systemctl restart nfs-kernel-server
$ showmount -e localhost
Export list for localhost:
/var/nfs/ubuntu_desktop *
lawrence@Lawrence-ThinkPad-X200:~$ lsusb
Bus 002 Device 004: ID 7392:7711 Edimax Technology Co., Ltd EW-7711UTn nLite Wireless Adapter [Ralink RT2870]
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 003: ID 17ef:480c Lenovo Integrated Webcam
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 002: ID 08ff:2810 AuthenTec, Inc. AES2810
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
lawrence@Lawrence-ThinkPad-X200:~$ usb-devices
T: Bus=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 4 Spd=480 MxCh= 0
D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
P: Vendor=7392 ProdID=7711 Rev=01.01
S: Manufacturer=RalinkS: Product=802.11 n WLAN
S: SerialNumber=1.0
C: #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=450mA
I: If#= 0 Alt= 0 #EPs= 7 Cls=ff(vend.) Sub=ff Prot=ff Driver=rt2800usb
T: Bus=04 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=5000 MxCh= 2
D: Ver= 3.00 Cls=09(hub ) Sub=00 Prot=03 MxPS= 9 #Cfgs= 1
P: Vendor=1d6b ProdID=0003 Rev=04.13
S: Manufacturer=Linux 4.13.0-32-generic xhci-hcd
S: Product=xHCI Host Controller
S: SerialNumber=0000:0d:00.0
C: #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=0mA
I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub
#!/bin/bash
if [ $# -eq 0 ]
then
echo "Usage: $0 lawrence"
else
grep "\<$1\>" /etc/passwd > /dev/null
RETVAL=$?
if [ $RETVAL -eq 0 ]
then
echo "Username $1 was found in the system"
else
echo "Cannot find username $1"
fi
fi
[ $# -eq 0 ] && { echo "Usage: $0 lawrence" ; exit 1; }
grep "\<$1\>" /etc/passwd > /dev/null
RETVAL=$?
[ $RETVAL -eq 0 ] && echo "Username $1 was found in the system" || echo "Cannot find username $1"




