Clone a melange VM: Difference between revisions

From Bitpost wiki
No edit summary
No edit summary
 
(7 intermediate revisions by the same user not shown)
Line 14: Line 14:
* reboot the VM
* reboot the VM
* verify IP and ssh
* verify IP and ssh
* migrate ~/config
* ~/config will be pointing to the config of the old box, migrate it
 
** create a new development/config/ubuntu/mahhost as a copy of the cloned one
Config will be pointing to the config of the old box.
** point ~/config to that
Wow, for some reason, /etc/fstab is stowed and working.  OK!
[~] cd development/config/ubuntu && cp -rp clonedhost mahhost
* create a new development/config/ubuntu/mahhost as a copy of the cloned one
[~] cd && rm config && ln -s /home/m/development/config/ubuntu/mahhost config
* point ~/config to that
[~] cd config && grep -i clonedhost * -R # update em all
* Wow, for some reason, /etc/fstab matches original cloned VM, and is still working?  OK!
* Check config hostname, it is likely that the old clonedhost hostname ws changed instead of the new mahhost
* run setup_stow.sh
* run setup_stow.sh
There will be some things to fix, as explained by setup_stow.sh warnings.  For example, removing existing ~/.bashrc symlink so it can be recreated.  A bit scary, but go for it it's a fucking clone!  MWAHAHAHA!
rm ~/.bashrc
sudo rm /etc/fstab /etc/hostname
$ m@ig1  [~] sudo mv /etc/systemd/journald.conf ~/backup
$ m@ig1  [~] sudo mv /etc/systemd/networkd.conf ~/backup
setup_stow.sh
* update bitpost hosts file, redistribute it (exhausting...)... does setup_stow.sh on each machine do this for us?  i can't remember...
* Add the new config folder, and commit all the config changes
* reboot and verify it all
* if you get a Brave "Profile in use" error on startup (only visible from command line start) because of the cloning, fix it:
rm /home/$USER/.config/Brave-Browser/SingletonLock

Latest revision as of 17:39, 28 August 2024

You can select any VM and clone it in VM.

For simpler VMs:

  • provide a hostname and ID for the new VM during clone, and hit OK
  • wait for proxmox to clone it (how do you monitor this, not sure yet...)
  • start it and open a console
  • the hostname will be old, fix it
sudo hostname mahhost
sudo emacs -nw /etc/hostname
  • get the MAC address
ip a
  • add an entry to dnsmasq and restart the service
🌵 m@bitpost  [~/config/etc/dnsmasq.d] emacs -nw /etc/dnsmasq.d/mdm_lan_dnsmasq.conf 
  • reboot the VM
  • verify IP and ssh
  • ~/config will be pointing to the config of the old box, migrate it
    • create a new development/config/ubuntu/mahhost as a copy of the cloned one
    • point ~/config to that
[~] cd development/config/ubuntu && cp -rp clonedhost mahhost
[~] cd && rm config && ln -s /home/m/development/config/ubuntu/mahhost config
[~] cd config && grep -i clonedhost * -R # update em all
  • Wow, for some reason, /etc/fstab matches original cloned VM, and is still working? OK!
  • Check config hostname, it is likely that the old clonedhost hostname ws changed instead of the new mahhost
  • run setup_stow.sh

There will be some things to fix, as explained by setup_stow.sh warnings. For example, removing existing ~/.bashrc symlink so it can be recreated. A bit scary, but go for it it's a fucking clone! MWAHAHAHA!

rm ~/.bashrc
sudo rm /etc/fstab /etc/hostname 
$ m@ig1  [~] sudo mv /etc/systemd/journald.conf ~/backup
$ m@ig1  [~] sudo mv /etc/systemd/networkd.conf ~/backup
setup_stow.sh
  • update bitpost hosts file, redistribute it (exhausting...)... does setup_stow.sh on each machine do this for us? i can't remember...
  • Add the new config folder, and commit all the config changes
  • reboot and verify it all
  • if you get a Brave "Profile in use" error on startup (only visible from command line start) because of the cloning, fix it:
rm /home/$USER/.config/Brave-Browser/SingletonLock