How to run gazebo from px4 running on vm(multipass)

Please help in running gazebo simulation GUI, i am running px4 from Virtual Machine (multipass) (ubuntu env).

i tried below methods but with no success.

Method 1 : Standalone

/PX4-Autopilot$ PX4_GZ_STANDALONE=1 make px4_sitl gz_x500
[0/1] cd /home/ubuntu/PX4-Autopilot/bu…topilot/build/px4_sitl_default/bin/px4


| ___ \ \ \ / / / |
| |/ / \ V / / /| |
| __/ / \ / /
| |
| | / /^\ \ ___ |
_| / / |_/

px4 starting.

INFO [px4] startup script: /bin/sh etc/init.d-posix/rcS 0
INFO [init] found model autostart file as SYS_AUTOSTART=4001
INFO [param] selected parameter default file parameters.bson
INFO [param] importing from ‘parameters.bson’
INFO [parameters] BSON document size 495 bytes, decoded 495 bytes (INT32:19, FLOAT:6)
INFO [param] selected parameter backup file parameters_backup.bson
INFO [dataman] data manager file ‘./dataman’ size is 1208528 bytes
INFO [init] Gazebo simulator 8.9.0
INFO [init] Standalone PX4 launch, waiting for Gazebo
INFO [init] Waiting for Gazebo world…
INFO [init] Waiting for Gazebo world…
INFO [init] Waiting for Gazebo world…
INFO [init] Waiting for Gazebo world…
INFO [init] Waiting for Gazebo world…
INFO [init] Waiting for Gazebo world…

and it runs out of time…

Method 2 : Usual method

ubuntu@xxxxxxxx:~/PX4-Autopilot$ make px4_sitl gz_x500
[0/1] cd /home/ubuntu/PX4-Autopilot/bu…topilot/build/px4_sitl_default/bin/px4


| ___ \ \ \ / / / |
| |/ / \ V / / /| |
| __/ / \ / /
| |
| | / /^\ \ ___ |
_| / / |_/

px4 starting.

INFO [px4] startup script: /bin/sh etc/init.d-posix/rcS 0
INFO [init] found model autostart file as SYS_AUTOSTART=4001
INFO [param] selected parameter default file parameters.bson
INFO [param] importing from ‘parameters.bson’
INFO [parameters] BSON document size 495 bytes, decoded 495 bytes (INT32:19, FLOAT:6)
INFO [param] selected parameter backup file parameters_backup.bson
INFO [dataman] data manager file ‘./dataman’ size is 1208528 bytes
INFO [init] Gazebo simulator 8.9.0
INFO [init] Starting gazebo with world: /home/ubuntu/PX4-Autopilot/Tools/simulation/gz/worlds/default.sdf
INFO [init] Starting gz gui
INFO [init] Waiting for Gazebo world…
INFO [init] Gazebo world is ready
INFO [init] Spawning model
INFO [gz_bridge] world: default, model: x500_0
INFO [lockstep_scheduler] setting initial absolute time to 3996000 us
INFO [commander] LED: open /dev/led0 failed (22)
WARN [health_and_arming_checks] Preflight Fail: ekf2 missing data
WARN [health_and_arming_checks] Preflight Fail: system power unavailable
WARN [health_and_arming_checks] Preflight Fail: No connection to the ground control station
INFO [uxrce_dds_client] init UDP agent IP:127.0.0.1, port:8888
INFO [mavlink] mode: Normal, data rate: 4000000 B/s on udp port 18570 remote port 14550
INFO [mavlink] mode: Onboard, data rate: 4000000 B/s on udp port 14580 remote port 14540
INFO [mavlink] mode: Onboard, data rate: 4000 B/s on udp port 14280 remote port 14030
INFO [mavlink] mode: Gimbal, data rate: 400000 B/s on udp port 13030 remote port 13280
INFO [logger] logger started (mode=all)
INFO [logger] Start file log (type: full)
INFO [logger] [logger] ./log/2025-05-24/17_02_18.ulg
INFO [logger] Opened full log file: ./log/2025-05-24/17_02_18.ulg
INFO [mavlink] MAVLink only on localhost (set param MAV_{i}BROADCAST = 1 to enable network)
INFO [mavlink] MAVLink only on localhost (set param MAV
{i}_BROADCAST = 1 to enable network)
INFO [px4] Startup script returned successfully
pxh> INFO [tone_alarm] home set
INFO [tone_alarm] notify positive
WARN [health_and_arming_checks] Preflight Fail: No connection to the ground control station
WARN [health_and_arming_checks] Preflight Fail: No connection to the ground control station
pxh> mavlink start -u 14550 -r 40000 -t 192.16xxxxx
INFO [mavlink] mode: Normal, data rate: 40000 B/s on udp port 14550 remote port 14550
pxh> INFO [commander] Ready for takeoff!

here, gazebo doesnt start.

Using PX4_GZ_STANDALONE means you expect that the gz server is already running.

The second method is correct. The GUI is probably not showing due to your VM settings. Can you launch the gui via command line?

gz sim

I am using Multipass - VM, which runs Ubuntu. And it opens a CLI type VM and no GUI based.
I tried to run gz sim and here is the output:

gz sim
qt.qpa.xcb: could not connect to display
qt.qpa.plugin: Could not load the Qt platform plugin “xcb” in “” even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.

Stack trace (most recent call last):
#31 Object “/lib/aarch64-linux-gnu/libruby-3.2.so.3.2”, at 0xfd725a1763af, in ruby_run_node
#30 Object “/lib/aarch64-linux-gnu/libruby-3.2.so.3.2”, at 0xfd725a171d57, in
#29 Object “/lib/aarch64-linux-gnu/libruby-3.2.so.3.2”, at 0xfd725a314257, in rb_vm_exec
#28 Object “/lib/aarch64-linux-gnu/libruby-3.2.so.3.2”, at 0xfd725a3113b7, in
#27 Object “/lib/aarch64-linux-gnu/libruby-3.2.so.3.2”, at 0xfd725a30cd23, in
#26 Object “/lib/aarch64-linux-gnu/libruby-3.2.so.3.2”, at 0xfd725a30aaa7, in
#25 Object “/lib/aarch64-linux-gnu/libruby-3.2.so.3.2”, at 0xfd725a24c6bb, in
#24 Object “/lib/aarch64-linux-gnu/libruby-3.2.so.3.2”, at 0xfd725a1744c7, in rb_protect
#23 Object “/lib/aarch64-linux-gnu/libruby-3.2.so.3.2”, at 0xfd725a318717, in rb_yield
#22 Object “/lib/aarch64-linux-gnu/libruby-3.2.so.3.2”, at 0xfd725a314257, in rb_vm_exec
#21 Object “/lib/aarch64-linux-gnu/libruby-3.2.so.3.2”, at 0xfd725a3113b7, in
#20 Object “/lib/aarch64-linux-gnu/libruby-3.2.so.3.2”, at 0xfd725a30cd23, in
#19 Object “/lib/aarch64-linux-gnu/libruby-3.2.so.3.2”, at 0xfd725a30aaa7, in
#18 Object “/usr/lib/aarch64-linux-gnu/ruby/3.2.0/fiddle.so”, at 0xfd7255076467, in
#17 Object “/lib/aarch64-linux-gnu/libruby-3.2.so.3.2”, at 0xfd725a2d2c37, in rb_nogvl
#16 Object “/usr/lib/aarch64-linux-gnu/ruby/3.2.0/fiddle.so”, at 0xfd7255075ec3, in
#15 Object “/lib/aarch64-linux-gnu/libffi.so.8”, at 0xfd725504383b, in
#14 Object “/lib/aarch64-linux-gnu/libffi.so.8”, at 0xfd7255046623, in
#13 Object “/usr/lib/aarch64-linux-gnu/libgz-sim8-gz.so.8.9.0”, at 0xfd72543fa693, in runGui
#12 Object “/lib/aarch64-linux-gnu/libgz-sim8-gui.so.8”, at 0xfd72542204eb, in gz::sim::v8::gui::runGui(int&, char**, char const*, char const*, int, char const*, char const*)
#11 Object “/lib/aarch64-linux-gnu/libgz-sim8-gui.so.8”, at 0xfd725421e9d3, in gz::sim::v8::gui::createGui(int&, char**, char const*, char const*, bool, char const*, int, char const*, char const*)
#10 Object “/lib/aarch64-linux-gnu/libgz-sim8-gui.so.8”, at 0xfd725421ae07, in gz::sim::v8::gui::launchQuickStart(int&, char**, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)
#9 Object “/lib/aarch64-linux-gnu/libgz-gui8.so.8”, at 0xfd72533ede43, in gz::gui::Application::Application(int&, char**, gz::gui::WindowType, char const*)
#8 Object “/lib/aarch64-linux-gnu/libQt5Widgets.so.5”, at 0xfd7252e18b97, in QApplicationPrivate::init()
#7 Object “/lib/aarch64-linux-gnu/libQt5Gui.so.5”, at 0xfd7251c71ec7, in QGuiApplicationPrivate::init()
#6 Object “/lib/aarch64-linux-gnu/libQt5Core.so.5”, at 0xfd7251874107, in QCoreApplicationPrivate::init()
#5 Object “/lib/aarch64-linux-gnu/libQt5Gui.so.5”, at 0xfd7251c6ea3f, in QGuiApplicationPrivate::createEventDispatcher()
#4 Object “/lib/aarch64-linux-gnu/libQt5Gui.so.5”, at 0xfd7251c6e64f, in QGuiApplicationPrivate::createPlatformIntegration()
#3 Object “/lib/aarch64-linux-gnu/libQt5Core.so.5”, at 0xfd725163124b, in QMessageLogger::fatal(char const*, …) const
#2 Object “/lib/aarch64-linux-gnu/libc.so.6”, at 0xfd7259d47dff, in abort
#1 Object “/lib/aarch64-linux-gnu/libc.so.6”, at 0xfd7259d5cb3b, in gsignal
#0 Object “/lib/aarch64-linux-gnu/libc.so.6”, at 0xfd7259da7608, in
Aborted (Signal sent by tkill() 1645 1000)
Escalating to SIGKILL on [Gazebo Sim Server]

  1. How to run gazebo in Multipass VM ?
  2. Is it possible to run gazebo on mac and run px4 on VM ?