Giter Site home page Giter Site logo

dianariyanto / virtual-display-linux Goto Github PK

View Code? Open in Web Editor NEW
496.0 11.0 45.0 559 KB

Create virtual display / monitor on linux OS for extended display via teamviewer or vnc server without any real Monitor is Plugged In.

License: MIT License

Shell 100.00%
teamviewer vnc linux-os monitor vdl-monitor remmina xrdp

virtual-display-linux's Introduction

Virtual Display Linux (VDL Monitor)

Just a simple bash script that create some virtual display / monitor on linux OS for extended display via TeamViewer or VNC server

Yes, you can add fake display monitor without real monitor attached!

⚠️⚠️⚠️⚠️ DISCLAIMER: Do with your own risk! ⚠️⚠️⚠️⚠️

Virtual Monitor Linux

Virtual Display Linux (VDL Monitor)

I'm using this simple script for extend my desktop pc to "2 external monitor" via teamviewer.

Device support

Curently this VDL Monitor only work for intel CPUs with integrated graphics only, sorry 😞

If you are using an Nvidia GPU, you can follow this instruction.

Or if you already made a mistake when trying this script on a device without an integrated intelhd gpu, which makes your device stuck on a black screen with blinking cursor, this instruction might be useful for you to fix this problem.

If you encounter a similar problem, you just need to delete /usr/share/X11/xorg.conf.d/20-intel.conf created by vdl-monitor to get your device booted normally again.

Quick Setup

  1. Install teamviewer on both devices. (You also can use VNC to)
  2. cd ~
  3. git clone https://github.com/dianariyanto/virtual-display-linux.git
  4. cd virtual-display-linux
  5. sudo chmod +x vdl-monitor
  6. Change your own resolution setup vdl-monitor.conf
  7. ./vdl-monitor
  8. For first running, you will prompt to reboot or relogin current session
  9. cd ~/virtual-display-linux/
  10. ./vdl-monitor
  11. Done.
dianariyanto@lenovo:~$ cd virtual-display-linux/
dianariyanto@lenovo:~/virtual-display-linux$ ./vdl-monitor 
Start configuration
add resolution 1368x768
start display VIRTUAL1 to 1368x768
Screen 0: minimum 8 x 8, current 2968 x 900, maximum 32767 x 32767
LVDS1 connected primary 1600x900+1368+0 (normal left inverted right x axis y axis) 310mm x 170mm
   1600x900      60.00*+  59.82  
   1400x900      59.88  
   1368x768      60.00    59.88    59.85  
   1360x768      59.80    59.96  
   1280x800      59.81    59.91  
   1152x864      60.00  
   1280x720      59.86    60.00    59.74  
   1024x768      60.00  
   1024x576      60.00    59.90    59.82  
   960x540       60.00    59.63    59.82  
   800x600       60.32    56.25  
   864x486       60.00    59.92    59.57  
   800x450       60.00  
   640x480       59.94  
   720x405       59.51    60.00    58.99  
   640x360       59.84    59.32    60.00  
DP1 disconnected (normal left inverted right x axis y axis)
DP2 disconnected (normal left inverted right x axis y axis)
DP3 disconnected (normal left inverted right x axis y axis)
HDMI1 disconnected (normal left inverted right x axis y axis)
HDMI2 disconnected (normal left inverted right x axis y axis)
HDMI3 disconnected (normal left inverted right x axis y axis)
VGA1 disconnected (normal left inverted right x axis y axis)
VIRTUAL1 connected 1368x768+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
   1368x768      60.00* 
VIRTUAL2 disconnected (normal left inverted right x axis y axis)

Done, Check your VDL Monitor on System Setting > Display
dianariyanto@lenovo:~/virtual-display-linux$ 

Check teamviewer client and select your virtual display act as external monitor.

You now success Add Fake Display with No Monitor is Plugged In!

VNC + Android Setup

Dependencies :

On the linux machine :
  • x11vnc
  • android-tools
  • libnotify
On the android phone/tablet :
  • VNCviewer, or any other vnc viewer for android

Installation steps :

  1. Enable developer mode on the android phone/tablet by entering int settings -> info and tapping on the release number 5 times
  2. Enable USB-debugging in developer settings on the android device
  3. Plug an USB cable between your two devices
  4. b) Depending on the android version you may need to go to your notifications, and look for a notification about the USB connection to allow debugging.
  5. Run adb shell on your Linux machine and approve the request on your android device
  6. Configure the variables in the script, internal is your computer monitor, you should get it with xrandr. screen1 and virtual1 are the resolutions of the screens
  7. start the script
  8. open the VNC app on your android device
  9. connect to http://127.0.0.1:5900

Confirmed

  • Elementary OS 5.0 Juno based on Ubuntu 18.04 with Teamviewer v.14.7.19.65
  • Pop OS! 20.04 Default Share Screen with Remmina Desktop Client
  • Armbian 5.0 xrdp with Realvnc Client
  • Fedora 34 - Gnome 40 on Xorg with Deskreen
  • Debian 11 - KDE Plazma with Deskreen
  • Manjaro Rolling - Gnome 40 on Xorg with x11vnc (server) realvnc (client) adb (for better fluidity)
  • Waiting your report here.

Remote Client

Useful links

virtual-display-linux's People

Contributors

abe-101 avatar augustin64 avatar dianariyanto avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

virtual-display-linux's Issues

Not working on Nvidia

Gdm does not load after reboot, remove /usr/share/X11/xorg.conf.d/20-intel fixes it. I supposse this only work on intel cards? Any ideas for nvidia gpu's?
nvidia 750ti btw

Intel HD 520 on Linux Mint 20.2 (Kernel 5.4.0-92) XrandR shows VIRTUAL1 and 2, but display manager does not

I am also getting a blank screen / crash when booting, but the system automatically recovers into safe mode.

Then I can restart Cinnamon and the system works fine, but I still can't seem to see VIRTUAL1 in my display settings.

When using an app like Deskreen to share one of my screens, I also cannot select any monitor other than my 'real' one (eDP1).

It's interesting that VIRTUAL1 and VIRTUAL2 both say 'disconnected'. Could that be the issue? Is there a way to 'connect' a virtual display?

No output VIRTUAL1

Upon running vdl-monitor, I receive this:

Start configuration
xrandr: cannot find output "VIRTUAL1"
add resolution 3040x1440
warning: output VIRTUAL1 not found; ignoring
start display VIRTUAL1 to 3040x1440

Followed by the output of xrandr and then

Done, Check your VDL Monitor on System Setting > Display

The file /usr/share/X11/xorg.conf.d/20-intel.conf exists with these contents:

Section "Device"
    Identifier "intelgpu0"
    Driver "intel"
    Option "VirtualHeads" "2"
EndSection

Of possible note is that I am running on hybrid graphics (integrated only is not an option in my BIOS, only hybrid and dedicated/nvidia-only), and that I have optimus-manager installed.

Glitch when create a 20-intel.conf file in X11 folder

Hello,

I tried to use this project and right after the first run and next reboot it creates the virtual monitors correctly but strange glitches appear on the screen

20-intel conf glitch

I can't understand what the problem is

Some info

uname -a Linux pop-os 5.4.0-7642-generic #46~1598628707~20.04~040157c-Ubuntu SMP Fri Aug 28 18:02:16 UTC x86_64 x86_64 x86_64 GNU/Linux
Graphic Card Intel Corporation UHD Graphics 630 (Mobile)

Any suggestion?

fail to boot (black screen) even with intel iGPU?

lspci yields:
2023-08-07 - 10-01-36
suggesting i do indeed have an intel iGPU. This is a 2020 intel macbook pro, running t2-ubuntu, but I am faced with the same black screen on boot as mentioned in other issues. odd, since i do seem to have an intel iGPU.

are there other prerequisites? some other configuration i'm missing? and what logs i should be checking so we can diagnose this?

Can't open display on Debian 11

         ./vdl-monitor
Start configuration
No protocol specified
Can't open display :0
add resolution 1920x1080
No protocol specified
Can't open display :0
start display VIRTUAL1 to 1920x1080
No protocol specified
Can't open display :0

Black screen after running

hello,What can be done to fix it?
The system is CentOS Linux release 7.9.2009 3.10.0-1160.el7.x86_64
The resolution I set is 1024*768
微信截图_20220531150227

Linux Mint 20.3 broken Display

Howdy, done everything like in tutorial. Got VIRTUAL1 not connected. In xrandr VIRTUAL1 and 2 are disconnected.

And after reboot my display is not showing background or any of xfce4 panels.

Not Compatible With Steam Deck

This software causes a permanent black screen on a Steam Deck after rebooting.

I'm suggesting adding another message on the readme warning to never run this on a steam deck since there's no way to solve this other than to re-install the OS. It does say "At your own risk" but making it clear that it's not compatible with steam deck is maybe a good idea.

Intel screen configuration crashes Wine and Proton.

https://forum.winehq.org/viewtopic.php?p=136039

Also tested personally on Debian 11.
The presence of the 20-intel.conf in the system will make both Wine and Valve Proton crash with any applications with a
wine: Unhandled page fault on execute access to 00007F9E9634C9F0 at address 00007F9E9634C9F0 (thread 0080), starting debugger...

I tried loading the new screen with Wine open. The screen loads fine, but Wine WILL crash with immediately after the screen is ready to be used with
wine: Unhandled page fault on execute access to 0000000000000000 at address 0000000000000000 (thread 029c), starting debugger...

Not working Mint 20.1/Nvidia

Firstly, thanks for this project, its a cool goal and every tablet or phone that is turned into reusable realestate and not landfill is noble in my book. So much kudos on this work.

The second point is that while you can't control some of the HowTos that are being published using these scripts, I think that people aren't always explaining the fact that it doesn't work on NVidia as written. As a solution for that I feel that there should be a section on how to uninsitall/restore your config. I spent some time with a black screen with a flashing cursor which would have freaked many linux users out.

Can I suggest a "How to remove" section?

I resolved the issue the following:

  1. Boot from a USB that has a live linux (eg. Ubuntu)
  2. Mount the root directory
  3. Open a terminal and cd /usr/share/X11/xorg.conf.d/
  4. sudo mv 20-intel.conf 20-intel.bak
  5. reboot

This solution assumes that the user doesn't in fact have an intel GPU. Maybe your script could back up the 20-intel.conf if it exists and the fix is to rename the back up back?

Anyway just a suggestion.

Not working on pop os 21.04??

i get this result wean i run the script

Start configuration
xrandr: cannot find mode "1920x1200"
add resolution 1920x1200
xrandr: cannot find mode 1920x1200
start display VIRTUAL1 to 1920x1200
Screen 0: minimum 8 x 8, current 1366 x 768, maximum 32767 x 32767
eDP1 connected primary 1366x768+0+0 (normal left inverted right x axis y axis) 340mm x 190mm
1366x768 59.97*+
1360x768 59.96
1280x720 59.74
1024x768 60.00
1024x576 60.00 59.90 59.82
960x540 60.00 59.63 59.82
800x600 60.32 56.25
864x486 60.00 59.92 59.57
640x480 59.94
720x405 59.51 60.00 58.99
680x384 60.00
640x360 59.84 59.32 60.00
DP1 disconnected (normal left inverted right x axis y axis)
HDMI1 disconnected (normal left inverted right x axis y axis)
VGA1 disconnected (normal left inverted right x axis y axis)
VIRTUAL1 disconnected (normal left inverted right x axis y axis)
VIRTUAL2 disconnected (normal left inverted right x axis y axis)
1920x1200_60.00 (0x16d) 193.160MHz -HSync +VSync
h: width 1920 start 2048 end 2256 total 2592 skew 0 clock 74.52KHz
v: height 1200 start 1201 end 1204 total 1242 clock 60.00Hz

Done, Check your VDL Monitor on System Setting > Display

i tried to modify it (because it wasn't working) in the line 6 and writing
xrandr --newmode "1920x1200_60.00" 193.16 1920 2048 2256 2592 1200 1201 1204 1242 -HSync +Vsync

and in the line 11 by replace LVDS1 to eDP1 didn't work ether and i change it again exactly as it was before i made the changes
What do i do to make it work or to delete the virtual displays?

This script broke my machine

I found this repo in the process of trying to use my android smartphone as second screen. This worked fine, I am able to create a virtual monitor and teamview to it from my smartphone. But, a huge problem is it make my PC extremely unstable, even after I stop using it. First of all, it create artifacts all over the place. Desktop wallpaper, app icons, system menubar, ... Some time it delete icon of some app too. This happen after every reboot, I have to reset the wallpaper picture after that.
Second, the PC often hang up after a long period of time inactive (no mouse, keyboard input), the only solution is unplug the PC and restart. I left my PC screenlocked overnight, with only 4 Firefox tabs and 1 Pycharm window open, it freeze the next morning. Even after 30min of lunch time, it get laggy, I have to save my works and reboot.
Screenshot from 2024-01-17 10-55-45

xrandr: Failed to get size of gamma for output default

Im quite a noob. I followed all your steps, but I get the following output:

Start configuration
xrandr: Failed to get size of gamma for output default
xrandr: cannot find output "VIRTUAL1"
add resolution 1280x720
xrandr: Failed to get size of gamma for output default
warning: output VIRTUAL1 not found; ignoring
start display VIRTUAL1 to 1280x720
xrandr: Failed to get size of gamma for output default
Screen 0: minimum 640 x 480, current 640 x 480, maximum 640 x 480
default connected primary 640x480+0+0 0mm x 0mm
   640x480       73.00* 

Done, Check your VDL Monitor on System Setting > Display

And when I got to settings, I cant see the other display.
Any Ideas?

xrandr: cannot find output "VIRTUAL1"

When running vdl-monitor I get this:

Start configuration
xrandr: cannot find output "VIRTUAL1"
add resolution 1920x1080
warning: output VIRTUAL1 not found; ignoring
start display VIRTUAL1 to 1920x1080

pls help

Green artifacting appeared on display after running

I've attached a screenshot of my desktop. These green artifacts appeared after I ran the script. They are entirely software, since they appear only on my desktop (they don't appear on top of windows) and appear in a screenshot.

The system is an LG Gram 14z980 with an i5 and integrated graphics, running ubuntu 20.04 LTS.
Screenshot from 2022-03-24 12-24-47

Update: Removing the provided 20-intel.conf file fixes the issue, but I'd love to be able to use this utility. What can be done to fix it?

Ubuntu 20.04 unable to boot properly after running Quick Setup instructions

Hi all, this issue is created to record down a quick dirty workaround for the following issue.

This purpose of creating this issue is to record down this workaround and provide information to other repository users in the event they encounter this same critical error when using the present codebase.

Will close after posting.

Issue Description

Running the instructions as listed under Quick Setup caused Ubuntu 20.04.3 to boot up to a black screen with blinking cursor.

Environment

  1. Operating System: Ubuntu 20.04.3 LTS
  2. Intel CPU: Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz
  3. GPU: Nvidia GeForce GTX 1060

Steps To Reproduce

cd $HOME
git clone [email protected]:dianariyanto/virtual-display-linux.git
cd vitual-display-linux
sudo ./vdl-monitor
reboot

Expected Behaviour

Computer reboots as per normal without error.

Actual Behaviour

Computer fails to boot to login screen, instead boots to black screen with flashing cursor.

Likely Cause of Error

It is likely due to the fact that I did not account for the fact that I am setting this up for a GPU-enabled environment. The 20-intel.conf generated by vdl-monitor bash script in this code-base has been confirmed to be main cause of why the computer is unable to boot properly.

Workaround ⚠️

This workaround is NOT TO RECTIFY THE ISSUE but to revert the computer back to a previous usable state. Follow the steps below to do so.

  1. Reboot the computer.
  2. Once the Bios Startup Screen pops up, press Escape button on your keyboard to access the GNU GRUB Menu.

But press the button slowly because pressing it too fast would cause you to skip the GRUB Menu entirely and enter the GRUB terminal interface immediately.

Confusing, huh? I know, right?

  1. Navigate to Advanced Options for Ubuntu.
  2. Navigate to any one of the Ubuntu kernel image and boot up in recovery mode.
  3. Navigate to root to enter into the terminal interface.
  4. Run the following command to login into your user account:
sudo login
# Enter your username.
# Enter your password.

If you encounter an error that looks like "System is booting up. Unprivileged users are not...", refer to this link to resolve:
https://unix.stackexchange.com/questions/487742/system-is-booting-up-unprivileged-users-are-not-permitted-to-log-in-yet

  1. You are now in your own personal account via the terminal. Delete the 20-intel.conf file under the following directory by using the following command:
sudo rm /usr/share/X11/xorg.conf.d/20-intel.conf
  1. Reboot. Your computer should now boot up as per normal.

Others

To clarify, this issue is just for recordance and supplementary help for other users like me who face this issue. The real cause of the error is probably because I did not properly read the part of configuring this code-base for Nvidia GPU. Ultimately, hopefully with this workaround recorded, it would prevent much frustrations for those who would choose to nuke their PCs and reinstall their OS to solve the issue (which was what I nearly chose to do, amidst tight project deadlines).

Black screen on every linux boot

I'm using Ubuntu 20.04.4 LTS on an HP 15s laptop, and my graphic card is an Interl UHD 620.

I'm a newbie who is transitioning from Windows to linux,

After the last command i got this (which I think is an error):
terminal

But the real problem is that now, at every boot, i have a black screen.
Now my pc works only with the Linux recovery mode (except from something like screen brightness change, that is always broken)

How can i solve the problem?

Caused a system failure on Ubuntu 20.04

I installed it on Ubuntu 20.04.
And after system reboot, the system isn't working.

Since this machine is remotely located, I don't have further details on what broke.

That machine also has a dedicated NVIDIA GPU. Not sure if it's related to that..
I don't even have details on how to revert the changes that your script made to the remote system.

Not working in Intel graphic with Driver "modesetting"

Using your script I was able to get a virtual display. But the screen was fuzzy and vlc didn't work or started lagging.
So I found that changing Driver "intel" to Driver "modesetting" resolves the fuzzy graphic issue.
This is what the 20-intel.conf looks like.

Section "Device"
    Identifier "intelgpu0"
    Driver "intel"
    Option "VirtualHeads" "2"
    Option "TearFree" "true"
EndSection

But after using this conf I'm unable to get the virtual display working.
After running the second command

xrandr --addmode VIRTUAL1 1920x1080
xrandr --output VIRTUAL1 --mode 1920x1080 --left-of eDP1

I get the following error
xrandr: Configure crtc 3 failed.

I tried looking for this specific error but didn't find anything.

OS: Ubuntu 20.04
Graphics: hybrid graphics

$ lspci | grep VGA    
>> 00:02.0 VGA compatible controller: Intel Corporation UHD Graphics (rev 05)
>> 01:00.0 VGA compatible controller: NVIDIA Corporation Device 1f95 (rev a1)

I have enabled Intel graphics using nvidia-prime by using NVIDIA on-demand mode(pic).
Also the /etc/X11/xorg.conf file looks like this

section "Device"
    Identifier      "intel"
    Driver          "modesetting"
    BusID           "PCI:0:2:0"
EndSection

Is there anyway to get this work?

How to Undo Changes

I ran the script and immediately my computer started hitching in the terminal and weird artifacts appeared on my desktop icons and backgrounds.

How do I revert the changes that the script made?

Provided 20-intel.conf kills my X

$ cat /etc/*-release

Manjaro Linux
DISTRIB_ID=ManjaroLinux
DISTRIB_RELEASE=21.2.0
DISTRIB_CODENAME=Qonos
DISTRIB_DESCRIPTION="Manjaro Linux"
Manjaro Linux
NAME="Manjaro Linux"
ID=manjaro
ID_LIKE=arch
BUILD_ID=rolling
PRETTY_NAME="Manjaro Linux"
ANSI_COLOR="32;1;24;144;200"
HOME_URL="https://manjaro.org/"
DOCUMENTATION_URL="https://wiki.manjaro.org/"
SUPPORT_URL="https://manjaro.org/"
BUG_REPORT_URL="https://bugs.manjaro.org/"
LOGO=manjarolinux

$ inxi -G

  Device-1: AMD Picasso driver: amdgpu v: kernel
  Device-2: IMC Networks Integrated Camera type: USB driver: uvcvideo
  Display: x11 server: X.Org 1.21.1.2 driver: loaded: amdgpu,ati
    unloaded: modesetting resolution: 1440x810~60Hz
  OpenGL: renderer: AMD Radeon Vega 8 Graphics (RAVEN DRM 3.42.0
    5.15.7-1-MANJARO LLVM 13.0.0)
    v: 4.6 Mesa 21.2.5

Could my problem be that I am unable to use your repository because of having an AMD iGPU rather than an Intel iGPU?

Occasional crash

Occasionally crashes while performing virtual screen switching

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.