Create template from a vm: Difference between revisions

From Jwiki
No edit summary
No edit summary
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
[[Category:Proxmox VE]]


 
== Implementation ==


1. Execute as root:
1. Execute as root:
Line 6: Line 7:
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
echo "" > ~/.bash_history
echo "" > ~/.bash_history
echo "" > /etc/resolv.conf
rm ~/.Xauthority
rm ~/.Xauthority
rm /etc/ssh/ssh_host_*
rm /etc/ssh/ssh_host_*
echo "" > /etc/machine-id
echo "" > /etc/machine-id
systemctl disable --now salt-minion.service
echo
rm -rf /etc/salt/pki/minion/*
rm -rf /etc/salt/pki/minion/*
echo "" > /etc/salt/minion_id
echo "" > /etc/salt/minion_id
echo "" > /etc/resolv.conf
history -c
history -c
exit
exit
</syntaxhighlight>
</syntaxhighlight>


1. Execute as other user (optional):
 
2. Execute as other user (optional):


<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
Line 27: Line 27:
exit
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