There is a laptop with Windows 10, VirtualBox is installed on it. The laptop has a "VirtualBox Host-Only Network" network adapter through which it communicates with the Ubuntu virtual machine via a local virtual network. VLAN uses static addresses.
The laptop is connected via Wi-fi to the Internet via a router. Dynamic addresses are used between the laptop and the router on the network.
There is a computer with Windows 10, it is connected via Wi-fi to the Internet through a router. Dynamic addresses are used on the network between the computer and the router. The router has a permanent Internet address.
This computer is also connected via Ethernet to the Ubuntu computer. This is a point-to-point connection and uses static addresses.
How can I SSH from an Ubuntu virtual machine to an Ubuntu computer on different LANs over the Internet?