The following command works on my linux laptop with an intel graphic card:
docker run -it --rm -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix rstudioxhost:verse
Alas, the same command does not work on my PC with an NVidia card. This is the error I get:
$ docker run -it --rm -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix rstudioxhost:verse
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-developer'
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
WebEngineContext used before QtWebEngine::initialize() or OpenGL context creation failed.
Failed to create OpenGL context for format QSurfaceFormat(version 2.0, options QFlags<QSurfaceFormat::FormatOption>(), depthBufferSize 24, redBufferSize -1, greenBufferSize -1, blueBufferSize -1, alphaBufferSize -1, stencilBufferSize 8, samples 0, swapBehavior QSurfaceFormat::DefaultSwapBehavior, swapInterval 1, colorSpace QSurfaceFormat::DefaultColorSpace, profile QSurfaceFormat::NoProfile)
Received signal 6
#0 0x7f06a8d19a4f <unknown>
#1 0x7f06a8d19e4b <unknown>
#2 0x7f06a8d1a4ce <unknown>
#3 0x7f06a3f82890 <unknown>
#4 0x7f06a22f7e97 gsignal
#5 0x7f06a22f9801 abort
#6 0x7f06a4214dcc QMessageLogger::fatal()
#7 0x7f06a19d3afc QQuickWidgetPrivate::handleContextCreationFailure()
#8 0x7f06a19d3cfa QQuickWidgetPrivate::createContext()
#9 0x7f06a19d5e86 QQuickWidget::resizeEvent()
#10 0x7f06ae40398d QtWebEngineCore::RenderWidgetHostViewQtDelegateWidget::resizeEvent()
#11 0x7f06a5378ea2 QWidget::event()
#12 0x7f06a19d6acb QQuickWidget::event()
#13 0x7f06ae403c88 QtWebEngineCore::RenderWidgetHostViewQtDelegateWidget::event()
#14 0x7f06a533ab3c QApplicationPrivate::notify_helper()
#15 0x7f06a5341d30 QApplication::notify()
#16 0x7f06a4401e28 QCoreApplication::notifyInternal2()
#17 0x7f06a537163d QWidgetPrivate::sendPendingMoveAndResizeEvents()
#18 0x7f06a53751b3 QWidgetPrivate::show_helper()
#19 0x7f06a5378375 QWidget::setVisible()
#20 0x7f06a724cfb6 QtWebEngineCore::WebContentsAdapter::initialize()
#21 0x7f06a724f21e QtWebEngineCore::WebContentsAdapter::load()
#22 0x7f06a724fb50 QtWebEngineCore::WebContentsAdapter::load()
#23 0x5573a14810ac rstudio::desktop::SessionLauncher::launchFirstSession()
#24 0x5573a148255b rstudio::desktop::SessionLauncher::onLaunchFirstSession()
#25 0x7f06a442e801 QObject::event()
#26 0x7f06a533ab3c QApplicationPrivate::notify_helper()
#27 0x7f06a5341d30 QApplication::notify()
#28 0x7f06a4401e28 QCoreApplication::notifyInternal2()
#29 0x7f06a4404857 QCoreApplicationPrivate::sendPostedEvents()
#30 0x7f06a4459bb3 postEventSourceDispatch()
#31 0x7f069b77c417 g_main_context_dispatch
#32 0x7f069b77c650 <unknown>
#33 0x7f069b77c6dc g_main_context_iteration
#34 0x7f06a44591ef QEventDispatcherGlib::processEvents()
#35 0x7f06a440078a QEventLoop::exec()
#36 0x7f06a4409190 QCoreApplication::exec()
#37 0x5573a1440a0f main
#38 0x7f06a22dab97 __libc_start_main
#39 0x5573a1443d8a _start
r8: 0000000000000000 r9: 00007ffe5ca5a140 r10: 0000000000000008 r11: 0000000000000246
r12: 00007ffe5ca5a470 r13: 00005573a1d46a50 r14: 00005573a1d46a50 r15: 00007ffe5ca5a9e0
di: 0000000000000002 si: 00007ffe5ca5a140 bp: 00005573a1d46a50 bx: 00007f06a4524e80
dx: 0000000000000000 ax: 0000000000000000 cx: 00007f06a22f7e97 sp: 00007ffe5ca5a140
ip: 00007f06a22f7e97 efl: 0000000000000246 cgf: 002b000000000033 erf: 0000000000000000
trp: 0000000000000000 msk: 0000000000000000 cr2: 0000000000000000
[end of stack trace]
Calling _exit(1). Core file will not be generated.
How can I fix this?