So I have this Node.js application which uses Puppeteer (alternative for eg, Selenium) which is a browser bot/web driver. For my specific use-case, I need to run Chrome headful, but I just cannot get it to work.

I have barely any Linux knowledge. I do have decent terminal knowledge because I'm on MacOS, but that's how far it goes.

The reason I want headless Ubuntu Server is to save RAM, because I really don't need a GUI for anything. Is it even possible to do what I'm trying to achieve?

So far I've tried using `Xvfb` but Chrome just gives me a bunch of errors:

root@x:~# Xvfb -ac :99 -screen 0 1280x1024x16 > /dev/null 2>&1 &
[1] 3204
root@x:~# DISPLAY=:99.0 chromium --no-sandbox
[3207:3284:0503/123414.921007:ERROR:object_proxy.cc(576)] Failed to call method: org.freedesktop.DBus.ListActivatableNames: object_path= /org/freedesktop/DBus: org.freedesktop.DBus.Error.AccessDenied: An AppArmor policy prevents this sender from sending this message to this recipient; type="method_call", sender=":1.5" (uid=0 pid=3207 comm="/snap/chromium/2842/usr/lib/chromium-browser/chrom" label="snap.chromium.chromium (enforce)") interface="org.freedesktop.DBus" member="ListActivatableNames" error name="(unset)" requested_reply="0" destination="org.freedesktop.DBus" (bus)
[3207:3207:0503/123415.185094:ERROR:chrome_browser_cloud_management_controller.cc(161)] Cloud management controller initialization aborted as CBCM is not enabled. Please use the `--enable-chrome-browser-cloud-management` command line flag to enable it if you are not using the official Google Chrome build.
[3207:3284:0503/123415.446231:ERROR:object_proxy.cc(576)] Failed to call method: org.freedesktop.DBus.ListActivatableNames: object_path= /org/freedesktop/DBus: org.freedesktop.DBus.Error.AccessDenied: An AppArmor policy prevents this sender from sending this message to this recipient; type="method_call", sender=":1.7" (uid=0 pid=3207 comm="/snap/chromium/2842/usr/lib/chromium-browser/chrom" label="snap.chromium.chromium (enforce)") interface="org.freedesktop.DBus" member="ListActivatableNames" error name="(unset)" requested_reply="0" destination="org.freedesktop.DBus" (bus)
[3306:3306:0503/123415.812393:ERROR:gl_surface_egl.cc(302)] No suitable EGL configs found.
[3306:3306:0503/123415.814730:ERROR:gl_context_egl.cc(160)] eglGetConfigAttrib failed with error EGL_BAD_CONFIG
libva error: /snap/chromium/2842/gnome-platform/usr/lib/x86_64-linux-gnu/dri/virtio_gpu_drv_video.so init failed
[3306:3306:0503/123415.889614:ERROR:gl_surface_egl.cc(302)] No suitable EGL configs found.
[3306:3306:0503/123415.889924:ERROR:gl_surface_egl.cc(1040)] eglCreatePbufferSurface failed with error EGL_BAD_CONFIG
[3306:3306:0503/123415.893292:ERROR:gpu_info_collector.cc(86)] gl::GLContext::CreateOffscreenGLSurface failed
[3306:3306:0503/123415.893950:ERROR:gpu_info_collector.cc(582)] Could not create surface for info collection.
[3306:3306:0503/123415.894861:ERROR:gpu_init.cc(103)] CollectGraphicsInfo failed.
[3306:3306:0503/123415.919347:ERROR:viz_main_impl.cc(198)] Exiting GPU process due to errors during initialization
(chrome:3207): IBUS-WARNING **: 12:34:16.415: Failed to mkdir /root/snap/chromium/2842/.config/ibus/bus: Not a directory
[3207:3358:0503/123416.661211:ERROR:object_proxy.cc(576)] Failed to call method: org.freedesktop.DBus.Properties.Get: object_path= /org/freedesktop/UPower: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.UPower was not provided by any .service files
[3207:3358:0503/123416.661747:ERROR:object_proxy.cc(576)] Failed to call method: org.freedesktop.UPower.GetDisplayDevice: object_path= /org/freedesktop/UPower: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.UPower was not provided by any .service files
[3207:3358:0503/123416.662276:ERROR:object_proxy.cc(576)] Failed to call method: org.freedesktop.UPower.EnumerateDevices: object_path= /org/freedesktop/UPower: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.UPower was not provided by any .service files
[3356:3356:0503/123417.103803:ERROR:gl_surface_egl.cc(302)] No suitable EGL configs found.
[3356:3356:0503/123417.104363:ERROR:gl_context_egl.cc(160)] eglGetConfigAttrib failed with error EGL_BAD_CONFIG
libva error: /snap/chromium/2842/gnome-platform/usr/lib/x86_64-linux-gnu/dri/virtio_gpu_drv_video.so init failed
[3356:3356:0503/123417.110956:ERROR:gl_surface_egl.cc(302)] No suitable EGL configs found.
[3356:3356:0503/123417.111222:ERROR:gl_surface_egl.cc(1040)] eglCreatePbufferSurface failed with error EGL_BAD_CONFIG
[3356:3356:0503/123417.111440:ERROR:gpu_info_collector.cc(86)] gl::GLContext::CreateOffscreenGLSurface failed
[3356:3356:0503/123417.111605:ERROR:gpu_info_collector.cc(582)] Could not create surface for info collection.
[3356:3356:0503/123417.111767:ERROR:gpu_init.cc(103)] CollectGraphicsInfo failed.
[3356:3356:0503/123417.138033:ERROR:viz_main_impl.cc(198)] Exiting GPU process due to errors during initialization
libva error: /snap/chromium/2842/gnome-platform/usr/lib/x86_64-linux-gnu/dri/virtio_gpu_drv_video.so init failed
[3339:3353:0503/123417.516431:ERROR:command_buffer_proxy_impl.cc(131)] ContextResult::kTransientFailure: Failed to send GpuControl.CreateCommandBuffer.

I have no clue about what's going on or how to even get started to fix any of these 😅

Hoping someone could help me out here, would be greatly appreciated!