IT数码 购物 网址 头条 软件 日历 阅读 图书馆
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
图片批量下载器
↓批量下载图片,美女图库↓
图片自动播放器
↓图片自动播放器↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁
 
   -> 系统运维 -> Linux 装机必备 -> 正文阅读

[系统运维]Linux 装机必备

CentOS/Redhat/Fedora 系統命令:

1. 安装软件源

rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org

#Centos8
yum install https://www.elrepo.org/elrepo-release-8.el8.elrepo.noarch.rpm

#Centos7
yum install https://www.elrepo.org/elrepo-release-7.el7.elrepo.noarch.rpm
# 备份当前repo文件
cp  /etc/yum.repos.d/CentOS-Base.repo  /etc/yum.repos.d/CentOS-Base.repo.back
# 下载ali cloud centos 源
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo 
# 安装扩展仓库
wget -O /etc/yum.repos.d/epel-7.repo wget http://mirrors.aliyun.com/repo/epel-7.repo 

# Fedora:
wget http://mirrors.aliyun.com/repo/fedora.repo -O /etc/yum.repos.d/fedora.repo

yum clean all 
yum makecache 

2. 安裝 Linux kernel 編譯依賴包

yum install -y dosfstools
yum install -y  grub2-efi-x64-modules.noarch
yum install -y  efibootmgr
yum -y  install gcc  gcc-c++
yum install -y ncurses ncurses-devel   
yum install -y elfutils-libelf-devel openssl-devel dwarves make flex bison
yum install -y glibc-static
yum -y install gcc gcc-c++ git python3 nasm iasl libuuid-devel qemu

或者
yum install -y gcc gcc-c++ git python3 nasm iasl libuuid-devel dosfstools ncurses ncurses-devel elfutils-libelf-devel openssl-devel dwarves make flex bison glibc-static 

3. 安装GUI

yum groupinstall "GNOME Desktop" "Graphical Administration Tools"
ln -sf /lib/systemd/system/runlevel5.target /etc/systemd/system/default.target

4. 編譯Linux kernel
//下载linux-4.18.1.tar.xz
wget https://mirrors.edge.kernel.org/pub/linux/kernel/v4.x/linux-4.18.1.tar.gz 

//解压linux-4.18.1.tar.xz
tar xvf linux-4.18.1.tar.gz -C /usr/src

//切换内核解压目录下
cd /usr/src/linux-4.18.1

//制作.config
# make mrproper
cp /boot/config-4.6.3-fc32.x86_64 /usr/src/linux-4.18.1/.config
make olddefconfig
或者
make menuconfig

//编译kernel
make all

//安装模块/内核
make modules_install 		
make install  			
reboot  				   

5. 製作busybox命令

CSDN=/root/csdn
TOP_BUILD=$CSDN/build
mkdidr -p $(TOP_BUILD)
cd $CSDN

#下载解压busybox源码
wget  https://busybox.net/downloads/busybox-1.26.2.tar.bz2  --no-check-certificate
tar xjf busybox-1.26.2.tar.bz2 

#生成.config
cd $CSDN/busybox-1.26.2
mkdir -pv $TOP_BUILD/obj/busybox-x86
make O=$TOP_BUILD/obj/busybox-x86 defconfig

make O=$TOP_BUILD/obj/busybox-x86 menuconfig
sed -i "s/.*CONFIG_STATIC.*/CONFIG_STATIC=y/" .config
(或者Busybox Settings  ---> Build BusyBox as a static binary (no shared libs).)

cd $TOP_BUILD/obj/busybox-x86
make -j2
make install

mkdir -pv $TOP_BUILD/initramfs/x86-busybox
cd $TOP_BUILD/initramfs/x86-busybox
mkdir -pv {bin,dev/tty0,sbin,etc,proc,sys/kernel/debug,usr/{bin,sbin},lib,lib64,mnt/root,root}

#copy 编译生成的busybox
cp -av $TOP_BUILD/obj/busybox-x86/_install/*  $TOP_BUILD/initramfs/x86-busybox
cp -av /dev/{null,console,tty,sda1} $TOP_BUILD/initramfs/x86-busybox/dev/

#创建init文件
cat > $TOP_BUILD/initramfs/x86-busybox/init < EOF
#!/bin/sh
mount -t proc none /proc
mount -t sysfs none /sys
#mount -t debugfs none /sys/kernel/debug
mdev -s
echo -e "\nBoot took $(cut -d' ' -f1 /proc/uptime) seconds\n"
#exec /bin/sh
exec /sbin/init
EOF
chmod +x $TOP_BUILD/initramfs/x86-busybox/init


#创建 ./etc/passwd与 ./etc/group 
echo "root::0:0:root:/:/bin/sh" > ./etc/passwd
touch  ./etc/group 

#创建 ./etc/inittab 
cat > ./etc/inittab << EOF
::sysinit:/etc/rc.d/rcS
::respawn:/sbin/getty -n -l /bin/sh ttyS0 115200
::respawn:/bin/cttyhack /bin/sh
::shutdown:/bin/umount -a -r
::shutdown:/sbin/swapoff -a
::restart:/sbin/init
EOF

#创建 . ./etc/fstab 
cat > ./etc/fstab << EOF
proc     /proc    proc     defaults 0 0
sys      /sys     sysfs    defaults 0 0
none     /dev     devtmpfs defaults 0 0
tmpfs    /dev/shm tmpfs    defaults 0 0
none     /dev/pts devpts   defaults 0 0
EOF

#创建 . ./etc/hostname
echo "busybox_csdn" >  ./etc/hostname

#创建  ./etc/rc.d/rcS
mkdir -p ./etc/rc.d/ && touch ./etc/rc.d/rcS

echo '#!/bin/sh
/bin/hostname -F /etc/hostname
/bin/mount /proc               # We need to do this before remounting root
/bin/mount /sys
/bin/mount -o remount,rw /     # Remount read-write
/bin/mount /dev
/bin/mkdir /dev/shm
/bin/mkdir /dev/pts
/bin/mount -a                  # Mount all filesystems in fstab, except those marked with 'noauto'
/sbin/ifconfig lo 127.0.0.1    # Setup loopback interface for network (if you have networking in your kernel)
#/sbin/inetd                    # If you want inetd to run
#/sbin/telnetd                  # If you want standalone telnetd to run -- incompatible with inetd it seems
' > ./etc/rc.d/rcS
chmod +x ./etc/rc.d/rcS

#创建 tty设备文件
mknod ./dev/tty1 c 4 1
mknod ./dev/tty2 c 4 2
mknod ./dev/tty3 c 4 3
mknod ./dev/tty4 c 4 4
ls -l ./dev/tty[0-9]

#打包initramfs
cd $TOP_BUILD/initramfs/x86-busybox
find . -print0 | cpio --null -ov --format=newc 	| gzip -9 > $TOP_BUILD/obj/initramfs-busybox-x86.cpio.gz

#对U盘前500MB清零
 dd if=/dev/zero of=/dev/sdb  bs=1M count=512;	

#对U盘(/dev/sdb)进行分区
gdisk /dev/sdb
GPT fdisk (gdisk) version 0.8.10

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.

Command (? for help): p
Disk /dev/sdb: 60062500 sectors, 28.6 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 2280F128-40B9-44EF-8972-59E8AA2C1DD3
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 60062466
Partitions will be aligned on 2048-sector boundaries
Total free space is 60062433 sectors (28.6 GiB)

Number  Start (sector)    End (sector)  Size       Code  Name

Command (? for help): n
Partition number (1-128, default 1):
First sector (34-60062466, default = 2048) or {+-}size{KMGTP}:
Last sector (2048-60062466, default = 60062466) or {+-}size{KMGTP}: 110MiB     
Current type is 'Linux filesystem'
Hex code or GUID (L to show codes, Enter = 8300): EF00
Changed type of partition to 'EFI System'

Command (? for help): p
Disk /dev/sdb: 60062500 sectors, 28.6 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 2280F128-40B9-44EF-8972-59E8AA2C1DD3
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 60062466
Partitions will be aligned on 2048-sector boundaries
Total free space is 59839200 sectors (28.5 GiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048          225280   109.0 MiB   EF00  EFI System

Command (? for help): n
Partition number (2-128, default 2):
First sector (34-60062466, default = 227328) or {+-}size{KMGTP}:
Last sector (227328-60062466, default = 60062466) or {+-}size{KMGTP}: 400MiB
Current type is 'Linux filesystem'
Hex code or GUID (L to show codes, Enter = 8300): 8300
Changed type of partition to 'Linux filesystem'

Command (? for help): p
Disk /dev/sdb: 60062500 sectors, 28.6 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 2280F128-40B9-44EF-8972-59E8AA2C1DD3
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 60062466
Partitions will be aligned on 2048-sector boundaries
Total free space is 59247327 sectors (28.3 GiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048          225280   109.0 MiB   EF00  EFI System
   2          227328          819200   289.0 MiB   8300  Linux filesystem

Command (? for help): w

Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!

Do you want to proceed? (Y/N): y
OK; writing new GUID partition table (GPT) to /dev/sdb.
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot.
The operation has completed successfully.
[root@localhost ~]#

#对U盘(/dev/sdb)进行格式化
fdisk -l  /dev/sdb
mkfs.vfat  -F 32 -s 2 /dev/sdb1
mkfs.ext3 /dev/sdb2

#对U盘安装bootloader这里用grub tool,也可以使用LILO
mkdir -p /mnt/boot/efi && mkdir -p /mnt/boot/grub
mount /dev/sdb2 /mnt/  && mount /dev/sdb1  /mnt/boot/efi
grub2-install --root-directory=/mnt/   --target=x86_64-efi   /dev/sdb

#创建EFI/BOOT/bootx64.efi,确保UEFI可以boot
mkdir -p  /mnt/boot/efi/EFI/BOOT
cp  /mnt/boot/efi/EFI/centos/grubx64.efi  /mnt/boot/efi/EFI/BOOT/bootx64.efi

# copy 本机的kernel 镜像(也可以自己编译)
cp  /boot/vmlinuz-3.10.0-514.el7.x86_64  /mnt/

#copy上面编译的busybox initramfs
cp   /root/csdn/build/obj/initramfs-busybox-x86.cpio.gz  /mnt/

# 获取主分区的UUID用来填充grub.cfg
lsblk -f

# Get UUID 
# In Grub UI,ls -l 
 8006ca13-d59a-4a28-8b02-e8c8eed498b4
 
mount /dev/sdb2 /mnt/
mount /dev/sdb1 /mnt/boot/efi
 
cp  /boot/vmlinuz-3.10.0-514.el7.x86_64  /mnt/
cp   /root/csdn/build/obj/initramfs-busybox-x86.cpio.gz  /mnt/
 
echo 'menuentry 'csdn-kernel-3.10.0-514.el7.x86_64' --class gnu-linux --class gnu --class os {
		insmod gzio
		insmod part_gpt
		search --no-floppy --fs-uuid --set  8006ca13-d59a-4a28-8b02-e8c8eed498b4
		echo 'Loading csdn kernel 3.10.0 ...'
		linux  /vmlinuz-3.10.0-514.el7.x86_64  rw init=/bin/sh console=ttyS0,9600n8 console=tty0 consoleblank=0 earlyprintk=ttyS0,9600 kgdboc=kbd,ttyS0 loglevel=7
		echo   'Loading initial ramdisk busybox  ...'
		initrd /initramfs-busybox-x86.cpio.gz
}'  > /mnt/boot/efi/EFI/centos/grub.cfg

 echo 'menuentry 'csdn-kernel-3.10.0-514.el7.x86_64' --class gnu-linux --class gnu --class os {
		insmod gzio
		insmod part_gpt
		search --no-floppy --fs-uuid --set  8006ca13-d59a-4a28-8b02-e8c8eed498b4
		echo 'Loading csdn kernel 3.10.0 ...'
		linux  /vmlinuz-3.10.0-514.el7.x86_64  rw init=/bin/sh console=ttyS0,9600n8 console=tty0 consoleblank=0 earlyprintk=ttyS0,9600 kgdboc=kbd,ttyS0 loglevel=7
		echo   'Loading initial ramdisk busybox  ...'
		initrd /initramfs-busybox-x86.cpio.gz
}'  > /mnt/boot/grub2/grub.cfg

cat /mnt/boot/efi/EFI/centos/grub.cfg

umount /dev/sdb1
umount /dev/sdb2

dd if=/dev/sdb bs=512 count=819201 of=./csdn_busybox2.img 
7za a csdn_busybox2.7z csdn_busybox2.img
scp root@192.168.1.18:/root/csdn_busybox2.7z .

# QEMU 启动busybox
chcp 65001 && "C:\Program Files\qemu\qemu-system-x86_64.exe" -bios "OVMF.fd" -M "pc" -m 256 -cpu "qemu64" -boot order=dc -serial stdio -hda csdn_busybox2.img
chcp 65001 && "C:\Program Files\qemu\qemu-system-x86_64.exe" -bios "OVMF.fd" -M "pc" -m 256 -cpu "qemu64" -boot order=dc -serial stdio -hda D:\share\centos7.img
chcp 65001 && "C:\Program Files\qemu\qemu-system-x86_64.exe" -bios "OVMF.fd" -M "pc" -m 256 -cpu "qemu64" -boot order=dc -serial stdio  -usbdevice disk:HDD_BOOT.img 

5. 编译并运行Ovmf開源固件命令

make -C /root/edk2/BaseTools/Source/C
./OvmfPkg/build.sh -D DEBUG_ON_SERIAL_PORT


# 在Centos下制作虚拟盘
# 新建HDD_BOOT.img的空文件
qemu-img create -f raw HDD_BOOT.img 64M 
# 格式化img文件
mkfs.vfat HDD_BOOT.img
# 将文件加载到设备文件
losetup  /dev/loop8 HDD_BOOT.img
#新建挂载目录
mkdir -p /mnt/hello
#将设备挂载到目录
mount /dev/loop8 /mnt/hello

cp ./Build/OvmfX64/DEBUG_GCC48/X64/HelloWorldPci.efi  /mnt/hello
cp ./Build/OvmfX64/DEBUG_GCC48/X64/DumpHobs.efi /mnt/hello
# 将efi文件回写到 HDD_BOOT.img
umount /dev/loop8
losetup -d /dev/loop8

qemu-system-x86_64 -bios ./Build/OvmfX64/DEBUG_GCC48/FV/OVMF.fd  \
-serial stdio -usb -drive if=none,format=raw,id=disk1,file=HDD_BOOT.img \
-device usb-storage,drive=disk1

6. 设置虚拟串口

sed 's/quiet/console=ttyS1,9600 loglevel=8/' -i /etc/default/grub grub2-mkconfig -o /boot/grub2/grub.cfg grub2-mkconfig -o /boot/efi/EFI/centos/grub.cfg reboot

7.對硬盤鏡像制作centos grub2

gdisk ./centos7.img
>t
losetup --offset 1MiB --sizelimit 1024MiB /dev/loop7 ./centos7.img
losetup --offset 1024MiB  /dev/loop8 ./centos7.img
mount /dev/loop8 /mnt2
mount /dev/loop7 /mnt2/boot/efi
grub2-install --efi-directory=/mnt2/   --target=x86_64-efi  ./centos7.img

8. 使能 SSH 遠程登陸

echo 'PasswordAuthentication yes
PermitRootLogin yes
AllowUsers root' >> /etc/ssh/sshd_config
service sshd restart

9. 修改語言

sed '/LANG=/cLANG="en_US.UTF-8"' -i /etc/locale.conf

10. 设置代理

export proxy="http://xxx.com:123(实际定义Port)"
export http_proxy=$proxy
export https_proxy=$proxy
echo 'sslverify=0' >> /etc/dnf/dnf.conf

echo '
export HTTP_PROXY="http://xxx.com:123(实际定义Port)/"
export HTTPS_PROXY="https://xxx.com:912/"
export http_proxy="http://xxx.com:123(实际定义Port)/"
export https_proxy="https://xxx.com:912/"
export FTP_PROXY="http://xxx.com:21/"
use_proxy=on
' >> /etc/profile.d/proxy.sh
chmod +x /etc/profile.d/proxy.sh

echo '
proxy="http://xxx.com:123(实际定义Port)/"
' >> /etc/dnf/dnf.conf

echo '
proxy="http://xxx.com:123(实际定义Port)/"
' >> /etc/yum.conf

10. 各種鏡像文件轉換

#轉換 vmdk为 img 文件
"C:\Program Files\qemu\qemu-img.exe"  convert Fedora-single.vmdk Fedora-single.img

#轉換 img為vmdk文件
"C:\Program Files (x86)\VMware\VMware Workstation\vmware-vdiskmanager.exe"  -r ".\Fedora 64 位.vmdk" -t 0 ".\Fedora-single.vmdk"

# 轉換img為vdi 
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" convertfromraw -format VDI Fedora-single.img Fedora-single.vdi

# 轉換vdi為img
"C:\Program Files\qemu\qemu-img.exe" convert -f vdi -O fwts-live-22.03.00-x86_64.vdi  fwts-live-22.03.00-x86_64.img 

# 轉換vmdk為vdi
"C:\Program Files\qemu\qemu-img.exe" convert -f vmdk -O vdi Fedora-single.vmdk Fedora-single.vmdk.vdi  
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe"  clonehd Fedora-single.vmdk Fedora-single.vdi --format VDI 

#轉換 vdi為 qcow2
"C:\Program Files\qemu\qemu-img.exe" convert -f vdi Fedora-single.vdi  -O qcow2 Fedora-single2.qcow2  

#轉換 vdi為 vmdk
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe"  clonehd Fedora-single.vdi Fedora-single.vmdk --format VMDK 

#轉換 vdi為 VHD
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe"  clonehd Fedora-single.vdi Fedora-single.vhd --format VHD 

# 設置鏡像文件UUID
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe"  showmediuminfo  Fedora-single.vdi
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe"  internalcommands sethduuid Fedora-single.vdi d8f845dc-1362-433a-8d56-0ee196fa4f6d

11. 设置串口免密码

cp /lib/systemd/system/serial-getty@.service /lib/systemd/system/serial-getty@.service.bak sed '/ExecStart=-/cExecStart=-/sbin/agetty -a root -8 -L %I 9600 $TERM' -i /lib/systemd/system/serial-getty@.service

12. 添加开机自启动程序

//编辑开机自启动脚本
vim /etc/rc.local

//设置开机自启动权限
chmod +x /etc/rc.d/rc.local

13. 忘记密码,重置root用户

# 方法一:
在 linux16 参数这行的最后面追加“rd.break
mount -o remount,rw /sysroot
chroot /sysroot
passwd
touch /.autorelabel
exit reboot


# 方法二:
//按e 进入编辑界面如下把ro改为?“rw init=/sysroot/bin/sh”. 然后 “Ctrl+x”启动
//依次输入以下命令进行root密码修改,修改完成之后退出 强制重启即可。
chroot /sysroot/passwd
passwd
touch /.autorelabel 
exit 
reboot

14、编译grub:

wget https://ftp.gnu.org/gnu/grub/grub-2.04.tar.xz
tar xvf grub-2.04.tar.xz
# ./configure && make && make install

15 Install VNC server

# yum -y install tigervnc-server
# vncserver //设置密码
# vncpasswd //设置密码
# echo "gnome-session &" >> /root/.vnc/xstartup

#yum install gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal
//fix the terminal could not open
# echo '
gnome-panel &  
gnome-settings-daemon &  
metacity &  
nautilus &  
gnome-terminal &
gnome-session &' >> /root/.vnc/xstartup

# echo '
#!/bin/bash
/sbin/iptables -I INPUT 1 -p TCP --dport 5901:5910 -j ACCEPT
vncserver -geometry 1920x1080' >> vnc.sh

# echo -e 'VNCSERVERS="1:root"
VNCSERVERARGS[1]="-geometry 1024x768"' >> /etc/sysconfig/vncservers

16. 配置LVM

# lvs // 查看VG
# lvcreate  -L 30.00g -n lvubutnu fedora_intel-obmc
# mkfs.ext4 /dev/fedora_intel-obmc/lvubutnu
# mount /dev/fedora_intel-obmc/lvubutnu /mnt

# lvcreate  -L 30.00g -n lvkernel fedora
# mkfs.ext4 /dev/fedora/lvkernel
# mount /dev/fedora/lvkernel /mnt

17. 运行QEMU 虚拟机

# qemu-img create -f qcow Ubuntu20.img 20G
# qemu-kvm  -enable-kvm  -boot d -cdrom ubuntu-20.04-desktop-amd64.iso -hda Ubuntu20.img -m 8192 
# qemu-kvm -m 8192 -enable-kvm Ubuntu20.img

echo 'qemu-kvm  -enable-kvm  -boot d -cdrom ubuntu-20.04-desktop-amd64.iso -hda Ubuntu20.img -m 8192' >> insatll_ubuntu.sh
chmod +x  insatll_ubuntu.sh

echo '
#!/bin/bash
qemu-kvm -L /mnt/img -m 8192 -hda /mnt/img/Ubuntu20.img -enable-kvm' > /mnt/img/setupvm.sh
chmod +x /mnt/img/setupvm.sh

echo '
#!/bin/bash
mount /dev/fedora_intel-obmc/lvubutnu /mnt
/mnt/img/setupvm.sh > /dev/null 2>&1 &' >> startvm.sh 
chmod +x startvm.sh

# lsusb --> Bus 001 Device 006: ID 0951:16a2 Kingston Technology DTR30G2
# qemu-kvm -m 8192 -enable-kvm Ubuntu20.img -usbdevice host:xxx:xxx

18. qemu + gdb debug kernel

19 . 开机设置网卡和打开kernel message

#grubby --update-kernel=ALL --args="console=tty0 console=ttyS0,115200n8 earlyprintk=ttyS0,115200 loglevel=9 "
#sed '/ONBOOT=/cONBOOT=yes' -i  /etc/sysconfig/network-scripts/ifcfg-ens3

Ubuntu/Demian 系統命令

1. Ubuntu设置为命令行(no-gui)登录

sed '/GRUB_CMDLINE_LINUX_DEFAULT=/cGRUB_CMDLINE_LINUX_DEFAULT="splash text"'  -i /etc/default/grub
update-grub

2. 安装软件源:

cp /etc/apt/sources.list /etc/apt/	sources.list.bak
echo 'deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
' > /etc/apt/sources.list 
apt update

虚拟机设置(VBOX, VMware)

1. 设置共享文件夹

# Vmware
#kernel headers
yum install kernel-devel
vmhgfs-fuse /mnt/hgfs
# Vbox
mkdir shared_linux
sudo mount -t vboxsf -o "uid=csdn,gid=csdn,dmode=0755,fmode=0755" shared_win ~/shared_linux

2. 设置虛擬串口

# Vmware
\\.\pipe\com_1 -> /dev/ttyS1
# VBOX
\\.\pipe\com_1 -> /dev/ttyS0

15. 设置UEFI啓動

# Vmware UEFI 啓動
VMware设置->选项->高级中,选择UEFI
(#Fix 固件类型无法选择UEFI“常规”,版本选择“Ubuntu64位”,工作目录选择一个别的路径)
# VBOX UEFI 啓動
設置->系統->啓用EFI

常用的下载网址

1. 下載fwt-live測試鏡像
https://fwts.ubuntu.com/fwts-live/
https://github.com/xypron/fwts
2. 下載vbox路径
http://download.virtualbox.org/virtualbox/6.0.0
  系统运维 最新文章
配置小型公司网络WLAN基本业务(AC通过三层
如何在交付运维过程中建立风险底线意识,提
快速传输大文件,怎么通过网络传大文件给对
从游戏服务端角度分析移动同步(状态同步)
MySQL使用MyCat实现分库分表
如何用DWDM射频光纤技术实现200公里外的站点
国内顺畅下载k8s.gcr.io的镜像
自动化测试appium
ctfshow ssrf
Linux操作系统学习之实用指令(Centos7/8均
上一篇文章      下一篇文章      查看所有文章
加:2022-05-24 18:35:01  更:2022-05-24 18:35:12 
 
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁

360图书馆 购物 三丰科技 阅读网 日历 万年历 2024年9日历 -2024/9/29 11:37:05-

图片自动播放器
↓图片自动播放器↓
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
图片批量下载器
↓批量下载图片,美女图库↓
  网站联系: qq:121756557 email:121756557@qq.com  IT数码