Welcome in a previous video. I talked about installing Ubuntu on the virtual machine manager on a Synology nas and
Today, I want to talk about cloning a machine. So where you might want to clone as if you are
Doing some development and you want to clone to try something out, or maybe you want to deploy different servers
But the base setup is the same
So you can clone a machine to do that
so I recently did that for another video I made which was using the apt-cacher-ng
I had to clone some machine, so I did it to save some time
So I'm going to go over the process I used now to do that
So I cloned this
app client one app client two and I want to make an app client 3
so I'll click this app client 2 and I'll go over here to shutdown and I'll click it and
I'll say shutdown. You can also log into machine to shut it down also and
Once this is shut down
we can go up here to action and say clone and
I'll name this one
App client 3 and I just want one copy and I'll hit OK
Okay, so it's cloned it and then we'll power it on
And I'll also power on apt client too
Okay, so both machines are up and running and you'll if you're looking here you may notice a problem that both of these have the
Same IP address which is not good that can cause all sorts of problems
so what we want to do is go into our clone machine and we'll hit connect and
We'll get into the interface here and I'll log into it
And what we need to do is
Change the machine ID. So to do that. We'll I'll type sudo space
RM -
RM space - f space and then etc
slash and then machine
- ID
Now we want to do a similar command I'll say sudo space RM space - F
space
/var/lib/dbus/machine-id
So now I've removed the machine ID from two locations. I want to type in sudo D bus
- UUID gen
Space - - and sure
Equals
/etc/machine-id
machine-id I may say the words wrong so look at the screen hit enter and
Then I'll push the up arrow and I'll do the same command and I'll remove the etc machine ID and
the equal sign
Okay, so now I'll type in sudo
space
nano
space /etc/hostname
and
I'll just change the hostname here
to act client 3 and I'll hit ctrl o and
enter to save then ctrl X to exit you can use any text editor to do that and
Then I'll just say sudo space reboot
This shouldn't take very long to reboot and then when we log back in we have one more thing to do
Okay, so I'm logged back in if we go over to the disc station now
It might take a second for this to update. There we go. So now it's giving us its own IP address
so it's looking at it as its own machine now and
The one last thing we have to do is this is running
OpenSSH server and it has the same key as the other machine
So the easy way to do this is just to say sudo space apt
space purged space open ssh server and
Then enter and then we'll type in the password
Now you can't I don't think you can do this if your SSH in the machine
But I'm using the virtual machine manager thing here and if you're sitting at the computer
It shouldn't be a problem either when I say it says do you want to continue? I'll say yes
And then I'll just say sudo space apt space install
OpenSSH server, and it will reinstall the server
There are other techniques you could use to
Reset the key
This is a simple one to do is to just purge it and then reinstall it and then you'll have a fresh key
so
So there we have it. We have cloned this machine. So then we can do with it. Whatever we want
There could be other software on a machine or other IDs, that would have to be changed or reset
But this is just the basics. These are just pretty much empty instances. There's nothing running on right now
So if you have any questions, please leave them in the comments
If you like this video, please click like if you haven't subscribed my channel
I would appreciate that and thanks for watching until next time. Goodbye