Hi,
You can do this. The connection always starts from the MacBook, not from the iMac's menu, so the MacBook needs Second Display running and has to stay awake with the lid closed.
Set this up on the MacBook once:
- Settings › General › Open at login: on, so Second Display starts with the MacBook.
- Settings › Pro › Keep running with the lid closed: on. It is on by default.
- Connect the MacBook to power and plug a keyboard and a mouse or trackpad into it. Without them macOS puts a closed MacBook to sleep, and the iMac's keyboard and mouse don't count here.
After that, connect the cable and the picture appears on the iMac. If the MacBook was asleep, press a key on its keyboard.
For the password, turn on Settings › Pro › Show login and lock screens on displays. The lock screen then shows on the iMac. Type the password on the keyboard connected to the MacBook. Once you're in, the iMac's keyboard and mouse control the MacBook.
The free trial is 7 days and includes Pro, so you can check this on your Macs.
Details: Sleep, wake and the lock screen, Login and lock screens.
Comments
I think I found a solution. I open Second Display on my iMac, then I open it on my Macbook and connect them by Wifi. I launch a session (of 5 minutes for example) on the free app Amphetamine so the Macbook keep the Wifi and the computer awake while closing the lid. Then I put it in the vertcal stand and just plug the thunderbolt cable so it can switch from wifi automatically.
That works. Once you plug in the Thunderbolt cable, the picture moves over to it by itself, as long as Prefer Thunderbolt is on.