User avatar
JaySch
Posts: 5
Joined: Thu Nov 03, 2016 6:52 pm

Pi 3b cloned sd to a new Pi 3b works sort of [Solved]

Thu Nov 03, 2016 7:44 pm

I have set up a Pi3 as a headless wireless label printer for our church and it works fine.
I need to set up multiple wireless label printers so I purchased 2 more Pi3 kits. Cloned the sd card from the first one and booted up the 2 new Pi3 form the cloned sd cards and all seemed good.

I set up our router to assign each Pi3 a unique IP for each wlan0 MAC Address and this works.
Each Pi3 has it's own IP.
I thought all was golden.

First thing I noticed when trying to employ the 2 cloned Pi3s is VNC server has same identity on all Pi3s. I have not yet found how to generate a new ID for the VNC server on the new Pi3s.
Connecting to the original Pi3 works flawlessly.
Connecting to the 2 new Pi3s with VNC viewer, I get the duplicate VNC server ID warning, I ok it, and it takes a long time to connect. Shutting down the new Pi3s from VNC viewer is not as smooth either.

The printer is a Dymo LabelWriter 450 Turbo served up by CUPS and works on the original Pi3 printing from a windows pc. This all local network.

Went to install a printer on the same windows pc for one of the new Pi3s,
using the same URL as the original Pi3 except for the IP address and the printer could not be found.

I'm guessing ('cause i'm new to this) that there is something unique about each Pi3 board that the OS needs to know.

Any help would be greatly appreciated.

User avatar
FTrevorGowen
Forum Moderator
Forum Moderator
Posts: 5715
Joined: Mon Mar 04, 2013 6:12 pm
Location: Bristol, U.K.
Contact: Website

Re: Pi 3b cloned sd to a new Pi 3b works sort of

Thu Nov 03, 2016 8:07 pm

When did you download the version of Raspbian you are cloning? Did you perform a sudo apt-get update and sudo apt-get dist-upgrade before cloning? (Since the release of Raspbian Jessie + Pixel and RealVNC in late September there have been some bugfixes as noted in the updated blog: https://www.raspberrypi.org/blog/introducing-pixel/ . There have also been some specific RealVNC startup script bug-fixes discussed in another thread which may relate to your problem)
Trev.
Still running Raspbian Jessie or Stretch on some older Pi's (an A, B1, 2xB2, B+, P2B, 3xP0, P0W, 2xP3A+, P3B+, P3B, B+, and a A+) but Buster on the P4B's. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm

User avatar
sconemad
Posts: 233
Joined: Thu Apr 28, 2016 1:47 pm
Location: Cambridge, UK
Contact: Website

Re: Pi 3b cloned sd to a new Pi 3b works sort of

Thu Nov 03, 2016 10:11 pm

You can force a new ID to be generated for the VNC server with the following command:

Code: Select all

sudo vncserver-x11 -generatekeys force
Then restart with:

Code: Select all

sudo systemctl restart vncserver-x11-serviced.service
(or just reboot)

The next time you connect you should get a warning that the ID has changed, but after that it should remember the new ID.

Not sure about the other issues you're having. Have you changed the hostname of each machine so they are all unique? (You can do this via raspi-config)

User avatar
DougieLawson
Posts: 39539
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Pi 3b cloned sd to a new Pi 3b works sort of

Fri Nov 04, 2016 4:03 pm

You should also regenerate the ssh keys with
sudo rm /etc/ssh/ssh_host*
sudo dpkg-reconfigure openssh-server

if you're going to run a cloned card on another system.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All fake doctors are on my foes list.

User avatar
JaySch
Posts: 5
Joined: Thu Nov 03, 2016 6:52 pm

Re: Pi 3b cloned sd to a new Pi 3b works sort of

Fri Nov 04, 2016 4:11 pm

Thanks Trev and Sconemad,
I do not have exact date. Last update and upgrade Oct 19-21.
I did not want to do another update/upgrade after I got it working.
One, it took a lot of research to get VNC server to start at boot up in this version of Raspbian.

I will generate new VNC sever IDs with the code provided.

I have not yet given each Pi3 a unique hostname.
To eliminate conflicts, I only have one Pi3 active on the network at a time.
Once I get the new Pi3s working like the first, I will then bring them on line at the same time.

Before I generate new VNC IDs, I am going to thoroughly test the cloned sd cards in the original Pi3.
Will post progress.

Dougie - Just saw your post, will do.

Thanks all - these Pi3s are cool.

User avatar
JaySch
Posts: 5
Joined: Thu Nov 03, 2016 6:52 pm

Re: Pi 3b cloned sd to a new Pi 3b works sort of

Tue Nov 08, 2016 1:48 pm

Before making changes, I tested all cloned sd cards on the original Pi3 and they work as expected.

On one of the cloned Pi3s.
I have regenerate the ssh keys.

Given it a unique hostname.

Force a new ID to be generated for the VNC server. (this changed nothing of the server ID)

None if this has resolved any of the issues of the cloned Pi3.

For the VNC server, I think I need to change the catch phrase but I can find no info on how to do this.
Or was the force generate new ID suppose to have done this.
If so, I may have to update and upgrade to see if this has been resolved.

I can access the CUPS browser interface and see that the printer is installed but can not connect to it from a windows pc.

Is there a "standard" list of commands that should be run upon wanting to move a sd card to a different, but identical model, Pi3?
Or config files that should be deleted and then reboot to regenerate?
Maybe a classroom has figured this out if students use different Pi3 each time they work on a project.

At this point I am going to do a fresh install but I would love to figure this out so I can update/upgrade one Pi3, test it and then clone it to the other Pi3s.

Thanks to all for any help.

User avatar
sconemad
Posts: 233
Joined: Thu Apr 28, 2016 1:47 pm
Location: Cambridge, UK
Contact: Website

Re: Pi 3b cloned sd to a new Pi 3b works sort of

Tue Nov 08, 2016 3:41 pm

JaySch wrote: Force a new ID to be generated for the VNC server. (this changed nothing of the server ID)

None if this has resolved any of the issues of the cloned Pi3.

For the VNC server, I think I need to change the catch phrase but I can find no info on how to do this.
Or was the force generate new ID suppose to have done this.
Yes, the catchphrase is generated from the ID (the idea is that it's more memorable, so easier to identify if it changes), so the catchphrase will change if the ID changes.

I had assumed that you were using the VNC Service mode server (enabled via raspi-config), but perhaps you are using a virtual mode server (started using the "vncserver" command?)
If this is the case, and if you are using the RealVNC package that comes with Raspbian Pixel, then the command to regenerate the private key would be:

Code: Select all

Xvnc -generatekeys force

User avatar
JaySch
Posts: 5
Joined: Thu Nov 03, 2016 6:52 pm

Re: Pi 3b cloned sd to a new Pi 3b works sort of

Mon Nov 14, 2016 2:28 pm

I'm a bit embarrassed,
The reason I could not connect to the printer is that I truncated the URL of the last 6 characters "_Turbo" when connecting from the windows PC.

Sconemad, your last post fixed the VNC issue.
The VNC server would not run on boot when enabled via raspi-config so I enabled it using a systemd service.
Which leads me to folly 2. I had updated the Pi3s but did not upgrade.
I have now upgraded one of the Pi3s and will check if VNC enabled via raspi-config runs on boot.

Dougie, thank you for the - regenerate the ssh keys

Trev, thanks for the obvious that I should have done - apt-get dist-upgrade after updating.

The regenerating keys for ssh and VNC was a big help with using cloned cards on multiple Pi3s!
Thanks all

User avatar
JaySch
Posts: 5
Joined: Thu Nov 03, 2016 6:52 pm

Re: Pi 3b cloned sd to a new Pi 3b works sort of

Mon Nov 14, 2016 2:36 pm

Is there a way to mark this post as Solved?

User avatar
FTrevorGowen
Forum Moderator
Forum Moderator
Posts: 5715
Joined: Mon Mar 04, 2013 6:12 pm
Location: Bristol, U.K.
Contact: Website

Re: Pi 3b cloned sd to a new Pi 3b works sort of

Mon Nov 14, 2016 4:47 pm

JaySch wrote:Is there a way to mark this post as Solved?
Yes, for future reference - just edit the title of your O.P., which I'll do for you shortly.
Trev.
Still running Raspbian Jessie or Stretch on some older Pi's (an A, B1, 2xB2, B+, P2B, 3xP0, P0W, 2xP3A+, P3B+, P3B, B+, and a A+) but Buster on the P4B's. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm

jhoward15
Posts: 3
Joined: Thu Nov 16, 2017 3:50 pm

Re: Pi 3b cloned sd to a new Pi 3b works sort of [Solved]

Fri Apr 27, 2018 1:43 pm

These commands allowed me to reregister a cloned rpi with the RealVNC servers:

Code: Select all

sudo systemctl stop vncserver-x11-serviced
sudo rm -rf /root/.vnc
sudo systemctl start vncserver-x11-serviced

popsmith
Posts: 2
Joined: Fri Sep 20, 2019 4:45 pm

Re: Pi 3b cloned sd to a new Pi 3b works sort of [Solved]

Sat Feb 01, 2020 4:54 pm

jhoward15 wrote:
Fri Apr 27, 2018 1:43 pm
These commands allowed me to reregister a cloned rpi with the RealVNC servers:

Code: Select all

sudo systemctl stop vncserver-x11-serviced
sudo rm -rf /root/.vnc
sudo systemctl start vncserver-x11-serviced
That Worked!!!. Thanks

Return to “Troubleshooting”