Converting from midi to xml on command line Ubuntu Server - Error

• Aug 5, 2014 - 23:53


I am trying to convert from midi to xml on an Ubuntu Server using the command line. I am getting the following error.

mscore.real: cannot connect to X server

Is there anyway to use mscore from the command line in Ubuntu?


Also seeing this issue with Musescore versions 1.3 and 2.0 when attempting to run on an Ubuntu 14.04 Amazon EC2 instance. Musescore has some great command line capabilities and this seems to be somewhat common for people to need a way to use them without an X server so I figured I'd make some noise here. I did find a workaround, thankfully, but it requires the installation of a virtual X server.

Attempting to run the following command fails (This conversion is the opposite of what OP jt419oh posted):
musescore out.xml -o out.mid

The following error messages occur with 1.3 and 2.0, respectively:
mscore.real: Cannot connect to X server
QXcbConnection: Could not connect to display

I've attempted the workaround suggested by "fatAngel", except with the Ubuntu setup mentioned above and this works. See the URL:

This workaround needs the following steps (Only tried this with 1.3 so far):
*Install Xvfb:
sudo apt-get install Xvfb
*Start Xvfb in the background (ignore font errors and press enter if prompt doesn't show up):
Xvfb :0 -screen 0 1280x768x24&
*Let the OS know which display to use (we're using ':0' here)
export DISPLAY=:0

After these steps, Musescore 1.3 and 2.0 command line functionality works "headless". BOOM!

Do you still have an unanswered question? Please log in first to post your question.