Create template from a vm: Difference between revisions
No edit summary |
No edit summary |
||
| (8 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
[[Category:Proxmox VE]] | |||
== Implementation == | |||
1. Execute as root: | 1. Execute as root: | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
echo "" > ~/.bash_history | |||
echo "" > /etc/resolv.conf | |||
rm ~/.Xauthority | |||
rm /etc/ssh/ssh_host_* | rm /etc/ssh/ssh_host_* | ||
echo "" > /etc/machine-id | echo "" > /etc/machine-id | ||
rm -rf /etc/salt/pki/minion/* | rm -rf /etc/salt/pki/minion/* | ||
echo "" > /etc/salt/minion_id | echo "" > /etc/salt/minion_id | ||
history -c | history -c | ||
exit | exit | ||
</syntaxhighlight> | </syntaxhighlight> | ||
2. Execute as other user (optional): | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
echo "" > ~/.bash_history | |||
rm ~/.Xauthority | rm ~/.Xauthority | ||
history -c | history -c | ||
sudo shutdown | sudo shutdown | ||
exit | |||
</syntaxhighlight> | </syntaxhighlight> | ||
3. On gui click on convert to template | |||
Latest revision as of 09:59, 27 August 2025
Implementation
1. Execute as root:
echo "" > ~/.bash_history
echo "" > /etc/resolv.conf
rm ~/.Xauthority
rm /etc/ssh/ssh_host_*
echo "" > /etc/machine-id
rm -rf /etc/salt/pki/minion/*
echo "" > /etc/salt/minion_id
history -c
exit
2. Execute as other user (optional):
echo "" > ~/.bash_history
rm ~/.Xauthority
history -c
sudo shutdown
exit
3. On gui click on convert to template