content of patch directory
# tree . ├── firewalld │ └── public.xml ├── oh-my-zsh │ └──.... ├── pass.txt ├── ssh │ ├── sshd_config │ └── mgr.pub └── sysctl ├── 97-net-tune-over-10g.conf.disabled ├── 97-net-tune-over-1g.conf.disabled ├── 97-net-tune-over-40g.conf.disabled └── 98-ipv6-disable.conf.disabled
ubuntu 16
virt-customize -a $IMG \ --timezone Asia/Seoul \ \ --install net-tools,tmux,wget,unzip,tar,gzip,vim,tree,sqlite3,zsh,git \ \ --copy-in oh-my-zsh:/ \ --copy /oh-my-zsh/templates/zshrc.zsh-template:/root/.zshrc \ --copy /oh-my-zsh/templates/zshrc.zsh-template:/etc/skel/.zshrc \ --run-command "sed -e 's#bash#zsh#g' -i /etc/passwd; echo" \ --run-command "sed -e 's#bash#zsh#g' -i /etc/default/useradd; echo" \ \ --copy-in sysctl/97-net-tune-over-10g.conf.disabled:/etc/sysctl.d/ \ --copy-in sysctl/97-net-tune-over-1g.conf.disabled:/etc/sysctl.d/ \ --copy-in sysctl/97-net-tune-over-40g.conf.disabled:/etc/sysctl.d/ \ --copy-in sysctl/98-ipv6-disable.conf.disabled:/etc/sysctl.d/ \ \ --run-command "[ ! -f /etc/ssh/sshd_config.bak ] && cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak; echo" \ --upload ssh/sshd_config:/etc/ssh/sshd_config \ \ --root-password file:pass.txt \ \ --ssh-inject root:file:ssh/mgr.pub \ \ --selinux-relabel virt-sysprep -a $IMG --operations defaults,-package-manager-cache,-ssh-userdir
ubuntu 18 ~ 22 (current)
virt-customize -a $IMG \ --timezone Asia/Seoul \ \ --install net-tools,tmux,wget,unzip,tar,gzip,vim,tree,sqlite3,zsh,git,semanage-utils \ \ --copy-in oh-my-zsh:/ \ --copy /oh-my-zsh/templates/zshrc.zsh-template:/root/.zshrc \ --copy /oh-my-zsh/templates/zshrc.zsh-template:/etc/skel/.zshrc \ --run-command "sed -e 's#bash#zsh#g' -i /etc/passwd; echo" \ --run-command "sed -e 's#bash#zsh#g' -i /etc/default/useradd; echo" \ \ --copy-in sysctl/97-net-tune-over-10g.conf.disabled:/etc/sysctl.d/ \ --copy-in sysctl/97-net-tune-over-1g.conf.disabled:/etc/sysctl.d/ \ --copy-in sysctl/97-net-tune-over-40g.conf.disabled:/etc/sysctl.d/ \ --copy-in sysctl/98-ipv6-disable.conf.disabled:/etc/sysctl.d/ \ \ --run-command "[ ! -f /etc/ssh/sshd_config.bak ] && cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak; echo" \ --run-command "semanage port -a -t ssh_port_t -p tcp 2204; echo" \ --upload ssh/sshd_config:/etc/ssh/sshd_config \ \ --root-password file:pass.txt \ \ --ssh-inject root:file:ssh/mgr.pub \ \ --selinux-relabel virt-sysprep -a $IMG --operations defaults,-package-manager-cache,-ssh-userdir
centos 7
virt-customize -a $IMG \ --timezone Asia/Seoul \ \ --install epel-release \ --install net-tools,tmux,wget,unzip,tar,gzip,vim,tree,sqlite,zsh,git,firewalld \ \ --upload firewalld/public.xml:/etc/firewalld/zones/public.xml \ --run-command "systemctl enable firewalld; echo" \ \ --copy-in oh-my-zsh:/ \ --copy /oh-my-zsh/templates/zshrc.zsh-template:/root/.zshrc \ --copy /oh-my-zsh/templates/zshrc.zsh-template:/etc/skel/.zshrc \ --run-command "sed -e 's#bash#zsh#g' -i /etc/passwd; echo" \ --run-command "sed -e 's#bash#zsh#g' -i /etc/default/useradd; echo" \ \ --copy-in sysctl/97-net-tune-over-10g.conf.disabled:/etc/sysctl.d/ \ --copy-in sysctl/97-net-tune-over-1g.conf.disabled:/etc/sysctl.d/ \ --copy-in sysctl/97-net-tune-over-40g.conf.disabled:/etc/sysctl.d/ \ --copy-in sysctl/98-ipv6-disable.conf.disabled:/etc/sysctl.d/ \ \ --run-command "[ ! -f /etc/ssh/sshd_config.bak ] && cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak; echo" \ --run-command "semanage port -a -t ssh_port_t -p tcp 2204; echo" \ --upload ssh/sshd_config:/etc/ssh/sshd_config \ \ --root-password file:pass.txt \ \ --ssh-inject root:file:ssh/mgr.pub \ \ --selinux-relabel virt-sysprep -a $IMG --operations defaults,-package-manager-cache,-ssh-userdir
centos 8, rocky
virt-customize -a $IMG \ --timezone Asia/Seoul \ \ --install epel-release \ --run-command "dnf config-manager --set-enabled powertools; echo" \ --install net-tools,tmux,wget,unzip,tar,gzip,vim,tree,sqlite,zsh,git,firewalld \ \ --upload firewalld/public.xml:/etc/firewalld/zones/public.xml \ --run-command "systemctl enable firewalld; echo" \ \ --copy-in oh-my-zsh:/ \ --copy /oh-my-zsh/templates/zshrc.zsh-template:/root/.zshrc \ --copy /oh-my-zsh/templates/zshrc.zsh-template:/etc/skel/.zshrc \ --run-command "sed -e 's#bash#zsh#g' -i /etc/passwd; echo" \ --run-command "sed -e 's#bash#zsh#g' -i /etc/default/useradd; echo" \ \ --copy-in sysctl/97-net-tune-over-10g.conf.disabled:/etc/sysctl.d/ \ --copy-in sysctl/97-net-tune-over-1g.conf.disabled:/etc/sysctl.d/ \ --copy-in sysctl/97-net-tune-over-40g.conf.disabled:/etc/sysctl.d/ \ --copy-in sysctl/98-ipv6-disable.conf.disabled:/etc/sysctl.d/ \ \ --run-command "[ ! -f /etc/ssh/sshd_config.bak ] && cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak; echo" \ --run-command "semanage port -a -t ssh_port_t -p tcp 2204; echo" \ --upload ssh/sshd_config:/etc/ssh/sshd_config \ \ --root-password file:pass.txt \ \ --ssh-inject root:file:ssh/msjang.pub \ \ --selinux-relabel virt-sysprep -a $IMG --operations defaults,-package-manager-cache,-ssh-userdir