Search Unity

Running a command line program on a virtual machine.

Discussion in 'Multiplayer' started by TheGaul, Apr 18, 2019.

  1. TheGaul

    TheGaul

    Joined:
    Apr 15, 2019
    Posts:
    199
    HI,
    I'm not too familiar with virtual machines. So I have a windows instance and I'm running a command line program (master server) in the dos window. It outputs text every so often. So I'm worried if I leave this running what will happen? Will the dos window fill up with text and eventually crash? If so what should I do?
     
  2. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    The last version of Windows which included DOS was Windows ME about 20 years ago.

    Command Prompt windows don't fill up and crash. You will eventually fill up the buffer, and you won't be able to scroll back and view the older output. I believe you can adjust this as Screen Buffer Size on the Layout tab of the Options menu for Command Prompt.

    If the information is important and you don't want to lose any of it, you should be able to redirect the output to a file instead of displaying it.
    Code (csharp):
    1. C:\folder> masterserver.exe > output.txt
    You can get a Windows version of the "tail" command to display the contents of the file in real time just as if it was still outputting to the console directly still.

    None of this has anything to do with being a virtual machine or not.
     
    Last edited: Apr 19, 2019
  3. TheGaul

    TheGaul

    Joined:
    Apr 15, 2019
    Posts:
    199
    That's good to know. I've got two programs running in the command prompt windows.

    Nah, I'm not really interested in keeping the text. I was just worried because it seemed an awful lot of text!

    I've got Windows 10 running in Azure. I hope it's stable and I won't have to keep restarting it. :confused:

    It just seems kind of weird to me that I have these programs running for 24 hours in the command prompt. I don't know if that is the proper way of doing things. Or maybe I should be redirecting the output to the Azure control panel or something.

    Took me about 2 days to compile all the files for Windows 10, and set up all the ports on Azure and so on. So that's not too bad I think. :)
     
  4. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    Is there a reason you aren't doing this with Linux instead? You pay a premium for Windows hosting vs Linux, and Linux is generally ideal for headless builds like you are doing. The only negative I know of is lack of IL2CPP build support.
     
  5. TheGaul

    TheGaul

    Joined:
    Apr 15, 2019
    Posts:
    199
    Well, ideally, I'd run it in a Linux build without a graphical interface since it doesn't require one. Plus it'd be cheaper.
    But, I figured since I'm not familiar with Linux, the amount of time I'd take to learn how to compile a program to Linux would outweigh the cost saved. So I've just gone with Windows which I know how to compile to. The Azure instance is only going to cost about $70 a year. Also, I needed to get it running fast. Only problem is I fully expect the Windows 10 instance to crash at some point.