CombineLinuxAndWin

分区:

/images/2024_04_19_11_44_17_781x330.jpg

安装windows:

/images/2024_04_19_11_53_02_642x471.jpg

Install on vdisk:

/images/2024_04_19_12_02_02_628x469.jpg

Continue to install :

/images/2024_04_19_12_02_34_650x473.jpg

rocklinuxrog

After installation, change the enpxxx to eth0 via:

 grubby --set-default /boot/vmlinuz-5.14.0-362.8.1.el9_3.x86_64 
 grubby --args="net.ifnames=0" --update-kernel="$(grubby --default-kernel)"
 grubby --args="biosdevname=0" --update-kernel="$(grubby --default-kernel)"

Install mono for using fog client:

yum install -y epel-release
sed -e 's|^metalink=|#metalink=|g' \
         -e 's|^#baseurl=https\?://download.fedoraproject.org/pub/epel/|baseurl=https://mirrors.ustc.edu.cn/epel/|g' \
         -e 's|^#baseurl=https\?://download.example/pub/epel/|baseurl=https://mirrors.ustc.edu.cn/epel/|g' \
         -i.bak \
         /etc/yum.repos.d/epel{,-testing}.repo
yum makecache
yum install -y mono-complete

Download the fog client SmartInstaller.exe, then:

sudo mono SmartInstaller.exe
...
hhhhhh.owgouwogwoegow.gowugou
...

Then you have to enable the ethtool service:

# cat /etc/systemd/system/wol.service 
[Unit]
Description=Enable Wake On Lan

[Service]
Type=oneshot
ExecStart = /sbin/ethtool --change eth0 wol g

[Install]
WantedBy=basic.target
# systemctl enable wol

Start and enable:

systemctl enable FOGService
systemctl start FOGService

LocalDNSOnFog

Install dnsmasq via:

sudo apt install -y dnsmasq

Edit the configuration file(vim /etc/dnsmasq.conf):

...

# 不允许 dnsmasq 通过轮询 /etc/resolv.conf 或者其他文件来获取配置的改变,则取消注释。
#no-poll
# 向上游所有服务器查询
all-servers
# 启用转发循环检测
dns-loop-detect
# 重启后清空缓存
clear-on-reload
# 完整域名才向上游服务器查询,如果是主机名仅查找 hosts 文件
domain-needed

# 指定 dnsmasq 默认查询的上游服务器,此处以 Google Public Dns 为例。
server=223.5.5.5

# no-hosts, 默认情况下这是注释掉的,dnsmasq 会首先寻找本地的 hosts 文件,再去寻找缓存下来的域名,最后去上级 Dns 服务器中寻找;而 addn-hosts 可以使用额外的 hosts 文件。
# Dns 解析 hosts 时对应的 hosts 文件,对应 no-hosts
addn-hosts=/etc/hosts
# Dns 缓存大小,Dns 解析条数
cache-size=1024
# 不缓存未知域名缓存,默认情况下 dnsmasq 会缓存未知域名并直接返回客户端
no-negcache
# 指定 Dns 同时查询转发数量
dns-forward-max=1000

# 增加一个域名,强制解析到所指定的地址上,强行指定 domain 的 IP 地址
address=/hhhhhh.ctyun.net.cn/192.168.1.22
...

Test via:

dig @192.168.1.22 hhhhhh.ctyun.net.cn
dig @192.168.1.22 www.baidu.com

Then edit the dhcpd.conf:

# vim /etc/dhcp/dhcpd.conf
....

option domain-name-servers 192.168.1.22;
....

x11dockerRunThunderbird

1. 前置条件

Ubuntu18.04操作系统,已安装x11docker, 安装方法详见x11docker github仓库。

2. 邮箱容器制作

撰写如下的Dockerfile:

FROM x11docker/xfce
RUN sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list
RUN apt-get update
RUN apt-get install -y firefox-esr thunderbird libreoffice fonts-wqy-microhei fonts-wqy-zenhei xfonts-wqy thunderbird-l10n-zh-cn firefox-esr-l10n-zh-cn libreoffice-help-zh-cn manpages-zh
RUN apt-get install -y fontconfig
RUN apt-get install -y evince
RUN apt-get install -y fcitx-pinyin fonts-arphic-uming
RUN fc-cache -fv
COPY locale.gen /etc/locale.gen
RUN apt-get install -y fcitx-pinyin fonts-arphic-uming
RUN apt-get install -y tzdata
RUN  apt-get install -y locales tzdata xfonts-wqy && \
    locale-gen zh_CN.UTF-8 && \
    locale-gen  && \
    update-locale LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8 LC_ALL=en_US.UTF-8 && \
    ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
ENV LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8 LC_ALL=en_US.UTF-8

其中locale.gen文件如下:

zh_CN.UTF-8 UTF-8

运行以下命令编译一个名为x11docker/securebrowser的容器:

$ docker build -t x11docker/securebrowser .

3. 容器启动及包装

撰写一个启动x11容器的命令文件:

$ cat /home/xxx/start_en.sh
read id < <(x11docker --showid --network=host --home x11docker/securebrowser thunderbird)
docker exec -e XMODIFIERS="@im=fcitx" -e QT_IM_MODULE="fcitx" -e GTK_IM_MODULE="fcitx" $id fcitx&

撰写一个桌面快速启动文件以快速调用:

$ cat /home/xxx/Secure.desktop
[Desktop Entry]
Version=1.0
Exec=xterm -e '/home/xxx/start_en.sh;sleep 10;bash'
Name=SecureApp
GenericName=SecureAPP
Comment=SecureApp
Encoding=UTF-8
Terminal=false
Type=Application
Categories=Application;Network;

注意需要安装xterm包以便可以方便的使用xterm调用启动文件。

CreatingFOGUbuntu2204UEFIImage

Configuration:

/images/2024_04_02_14_40_40_489x210.jpg

After installation, do following:

# scp test@xxxxxx.xxx/grubdebs .
# ls grubdebs
grub2-common_2.06-13+deb12u1_amd64.deb
grub-common_2.06-13+deb12u1_amd64.deb
grub-efi-amd64_2.06-13+deb12u1_amd64.deb
grub-efi-amd64-bin_2.06-13+deb12u1_amd64.deb
grub-efi-amd64-signed_1+2.06+13+deb12u1_amd64.deb
grub-pc_2.06-13+deb12u1_amd64.deb
grub-pc-bin_2.06-13+deb12u1_amd64.deb
install.sh
libfuse2_2.9.9-6+b1_amd64.deb
shim-helpers-amd64-signed_1+15.7+1_amd64.deb
shim-signed_1.39+15.7-1_amd64.deb
shim-signed-common_1.39+15.7-1_all.deb
shim-unsigned_15.7-1_amd64.deb
# mv grub-pc* ../
# dpkg -i *.deb
# cd ..
# dpkg -i *.deb

hold the installed packages:

# apt-mark hold grub-common grub-efi-amd64 grub-efi-amd64-bin grub-efi-amd64-signed grub-pc grub-pc-bin grub2-common libfuse2 shim-helpers-amd64-signed shim-signed:amd64 shim-signed-common shim-unsigned

Reinstall the grub to let the new package take effect:


sudo umount /boot/efi
sudo mkfs.vfat -F32 /dev/vda1
sudo mount /dev/vda1 /boot/efi
sudo update-grub
sudo update-grub2
sudo grub-install /dev/vda
sudo grub2-mkconfig -o /boot/efi/EFI/ubuntu/grub.cfg
vim /etc/fstab
change efi 
sudo reboot

Install fog-client(ubuntu2204):

sudo apt update
sudo apt install nuget
sudo apt install mono-complete
sudo apt install apt-transport-https
sudo mono SmartInstaller.exe

/images/2024_04_02_15_11_19_782x549.jpg Now shutdown the machine, Change to pxe mode, to test its start-up.

/images/2024_04_02_15_14_42_464x247.jpg

Registeration image:

/images/2024_04_02_15_57_50_887x487.jpg

Associate the image with newly created image:

/images/2024_04_02_15_57_19_1074x461.jpg

Capture the image from this node:

/images/2024_04_02_15_58_22_943x398.jpg

partclone and upload the image:

/images/2024_04_02_16_00_17_558x372.jpg