c++qtdockervirtual-machineopenvz

Virtualise and duplicate Qt application 20 times


I want to virtualise and duplicate an application which I've developed in C++ on Qt (Windows with Qt 5.9.1). The application is already developed and I want to duplicate it 20 times.

Note: each instance of the application needs to have a different IP address because my application use network to work.

I've thought about working with openVz or Docker. What is the best way to virtualise and duplicate an application?


Solution

  • You don't need these tools.

    The first thing to do is to remove your artificial "1 application' limit. By default, Windows allows multiple instances of the same running program, so you did something to prevent it. Stop doing that.

    The next thing to do is to assign 20 IP addresses to the machine. That follows pretty directly from your requirements.

    Finally, you need to bind to a specific IP address instead of 0.0.0.0. Enumerate all available interfaces, and try them in random order. (Efficiency - if you tried them in the same order, all 20 instances would try to grab the first IP, and 19 of them would fail. On the second attempt, 18 would fail. Randomizing means that most instances bind with a few tries).