# How to run Unity in “headless” mode?

I need to run my game without graphics and user input (headless mode).

I googled it but I actually couldn't find a solution, except something like this:

using UnityEngine;
using System.Collections;
using UnityEditor;

public class a : MonoBehaviour {

public static void BeforeBuild()
{
}
}


Unfortunately, this doesn't work for me as it seems to work only on Linux.

Am I forced to run my instance on Linux?

I would be really thankful if anyone could help me!

• "I need to run my game in headless mode" is it really what you need? Or you need something that is provided by the headless mode. – Vaillancourt Aug 17 '16 at 14:36
• This may be useful to you. (Thank Google.) – Vaillancourt Aug 17 '16 at 14:39
• I'm pretty sure that if you'd followed the tutorial I linked you in your other question you wouldn't have asked this one – Leggy7 Aug 17 '16 at 14:44
• From your other question: but now I'm going to learn new unity's network service (unet). so befor start, I have question: can I host my own server in unet? Is this a something a taught UNET developer would say? If you follow closely that tutorial you will find out how a master is chosen among peer to act like a server. – Leggy7 Aug 17 '16 at 15:41
• Honestly, @david's question is pretty reasonable, and the question does make sense. I'm not really sure why people get so nasty about questions like this. Actually, a quick Googling didn't really pull up immediate results for the question. I may have asked this here myself had I needed the feature. – Jesse Williams Aug 17 '16 at 16:40

• -batchmode can also be useful for automated testing. – Philipp Aug 17 '16 at 14:40