@@ -602,8 +602,11 @@ sub waitForX {
602602 $self->nest("waiting for the X11 server", sub {
603603 retry sub {
604604 my ($status, $out) = $self->execute("journalctl -b SYSLOG_IDENTIFIER=systemd | grep 'session opened'");
605+ my $display = $ENV{'DISPLAY'};
606+ $display =~ s/://;
607+
605608 return 0 if $status != 0;
606− ($status, $out) = $self->execute("[ -e /tmp/.X11-unix/X0 ]");
609+ ($status, $out) = $self->execute("[ -e /tmp/.X11-unix/X$display ]");
607610 return 1 if $status == 0;
608611 }
609612 });