Could not launch the Environment in the Ubuntu Server through vncserver


I install the environment in the Ubuntu server, and the X-server status is inactive. Then I install vncserver in Ubuntu server and I can use MobaXterm (software in Windows) in my PC to connect it and the screen shows normally, like the following picture:

I test with the gym environment, it works fine:

But it failed when I launched the MineRL environment,

Traceback (most recent call last):
File “”, line 23, in
File “”, line 6, in hello_world
env = gym.make(‘MineRLNavigateDense-v0’)
File “/mnt/home/lll/anaconda3/envs/minecraft/lib/python3.6/site-packages/gym/envs/”, line 156, in make
return registry.make(id, **kwargs)
File “/mnt/home/lll/anaconda3/envs/minecraft/lib/python3.6/site-packages/gym/envs/”, line 101, in make
env = spec.make(kwargs)
File “/mnt/home/lll/anaconda3/envs/minecraft/lib/python3.6/site-packages/gym/envs/”, line 73, in make
env = cls(
File “/mnt/home/lll/anaconda3/envs/minecraft/lib/python3.6/site-packages/minerl/env/”, line 133, in init
self.instance = self._get_new_instance(port)
File “/mnt/home/lll/anaconda3/envs/minecraft/lib/python3.6/site-packages/minerl/env/”, line 155, in _get_new_instance
File “/mnt/home/lll/anaconda3/envs/minecraft/lib/python3.6/site-packages/minerl/env/”, line 466, in launch
File “/mnt/home/lll/anaconda3/envs/minecraft/lib/python3.6/site-packages/minerl/env/”, line 753, in _check_for_launch_errors
"ERROR! MineRL could not detect an X Server, Monitor, or Virtual Monitor! "
RuntimeError: ERROR! MineRL could not detect an X Server, Monitor, or Virtual Monitor!
In order to run minerl environments WITHOUT A HEAD use a software renderer such as ‘xvfb’:
xvfb-run python3 <>
! NOTE: xvfb conflicts with NVIDIA-drivers!
! To run headless MineRL on a system with NVIDIA-drivers, please start a
! vnc server of your choosing and then `export DISPLAY=:<insert ur vnc server #>
If you’re receiving this error and there is a monitor attached, make sure your current displayvariable is set correctly:
DISPLAY=:0 python3 <>
! NOTE: For this to work your account must be logged on the physical monitor.
If none of these steps work, please complain in the discord!
If all else fails, JUST PUT THIS IN A DOCKER CONTAINER! :slight_smile: