This guide uses [Deskreen](https://github.com/pavlobu/deskreen) on Pop! OS 20.04 # 1. Virtual Display Output Deskreen can share any display as long as it is detected via `xrandr`, but to be able to have a display show up exlusively on a secondary device, there needs to be an unused display output. Most GPUs and laptops have additional display-out ports (HDMI/DisplayPort/DVI) that can be used. But in my case, I use my TV as a primary display, while casting my laptop's screen to my phone, as my laptop's display doesn't work anymore. ## Add a Virtual Output ### A. Open up terminal app and enter `xrandr --listmonitors` to check out all available display ports. The output will be something like this. ```bash Monitors: 2 0: +*HDMI-A-0 1920/575x1080/323+0+0 HDMI-A-0 1: +eDP 1366/344x768/193+1920+0 eDP ``` As you can see, I have total 2 display outputs, `HDMI-A-0` (HDMI Port) and `eDP` (laptop's primary display, which is currently unused). ### B. Use an existing `eDP | HDMI | DVI | etc.` output as a virtual one: #### i. Declare Variables: ```bash # REPLACE THESE VARIABLES WITH YOUR OWN VALUES: virtual_output_name=eDP # Unused output that you want to use for Deskreen desired_resolution_width=1366 # Put the max for your display (eg. 1920) desired_resolution_height=768 # Put the max for your display (eg. 1080) relative_position=right-of # Options: right-of, left-of , above, below relative_to_output_name=HDMI-A-0 # My current display that I used as a reference ``` #### ii. Enable the display output, and show info ```bash xrandr --output $virtual_output_name --mode "$desired_resolution_width"x$desired_resolution_height --$relative_position $relative_to_output_name echo -e "\nEXECUTING: \n" echo -e xrandr --output "$virtual_output_name" echo -e --mode "$desired_resolution_width"x"$desired_resolution_height" echo -e --"$relative_position" "$relative_to_output_name" "\n"; xrandr # processed command will look like: # xrandr --output eDP --mode 1366x768 --right-of HDMI-A-0 ```
Here is my output after enabling virtual output for `eDP`
```bash
EXECUTING: xrandr --output eDP --mode 1920x1080 --right-of HDMI-A-0
Screen 0: minimum 320 x 200, current 3286 x 1080, maximum 16384 x 16384
eDP connected 1366x768+1920+0 (normal left inverted right x axis y axis) 344mm x 193mm
1366x768 60.00*+ 47.99
1280x720 60.00
1024x768 60.00
800x600 60.00
640x480 60.00
1920x1080 60.00
HDMI-A-0 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 575mm x 323mm
1920x1080 60.00*+ 60.00 50.00 59.94 24.00 23.98
1680x1050 59.88
1280x1024 60.02
1440x900 60.00
1280x960 60.00
1360x768 60.02
1280x800 59.91
1280x720 60.00 50.00 59.94
1024x768 60.00
800x600 60.32 56.25
720x576 50.00
720x480 60.00 59.94
640x480 60.00 59.94
720x400 70.08
```