{"id":200,"date":"2016-12-23T21:12:14","date_gmt":"2016-12-23T15:42:14","guid":{"rendered":"http:\/\/madhurendra.com\/?p=200"},"modified":"2017-02-23T22:26:57","modified_gmt":"2017-02-23T16:56:57","slug":"adding-display-network","status":"publish","type":"post","link":"https:\/\/madhurendra.com\/adding-display-network\/","title":{"rendered":"Adding a display over network !"},"content":{"rendered":"

\"\"<\/a><\/p>\n

You are doomed if your laptop has only one HDMI Port & you\u00a0are running Linux\u00a0in that box.<\/p>\n

Unlike windows – where there are tons of easy to run solution, & there are still tons of solutions if you have big numbers in your pocket.<\/p>\n

Certainly – I neither wish to spend money on external VGA\/HDMI extender or docking station nor to change OS. So after googling a lot I discovered a solution which utilized a different machine to act as the streaming client. You can use RPI or an old p4 machine.<\/p>\n

Below is how it works.<\/p>\n

    \n
  1. Adds a virtual display on your machine, usually all graphics card support at least one virtual display. \u00a0You do all this using xrandr<\/code><\/li>\n
  2. Create a VNC Server to stream that display – but since you cannot each time run two commands just to connect display – we are running VNCViewer<\/code> in listen mode<\/code><\/li>\n
  3. Connect to vnc viewer & keep running it in the background.<\/li>\n<\/ol>\n

    You Laptop —[Display Data]—> Network —-> VNCViewer<\/p>\n

    As suggested above you data is being streamed over the network \u00a0– you cannot run 4k data. But if you have good Lan speed you won’t face any problem.<\/p>\n

    I have also optimized settings for best experience – so far I can use terminal, watch videos – the only drawback is you feel the lag when you use keyboard or mouse for realtime feedback.<\/p>\n

    In Client Machine, i.e. your laptop.<\/strong><\/p>\n

    You will need to install x11vnc & screen<\/p>\n

    #!\/bin\/bash\r\n#Run VNC server in remote device. 10.0.0.2 is my machine which has monitor connected.\r\nssh  root@10.0.0.2 \"nohup \/root\/vncserver.sh > \/dev\/null 2>&1 &\"\r\nxrandr --addmode VIRTUAL1 1920x1080\r\nxrandr --output VIRTUAL1 --mode 1920x1080 --right-of eDP1 # find your main display\r\nscreen -X -S vnc quit\r\nkillall x11vnc\r\n# adjust postion 1920x1080+3511+180, i.e. 3511+180 accordingly\r\n# i have different resultion display so had to move.\r\nscreen -dmS vnc  x11vnc -connect 10.0.0.2:5500  -display :0 -clip 1920x1080+3511+180 -wirecopyrect  -viewonly --nossl -ncache 10 -ncache_cr\r\n<\/pre>\n

    In server Machine (LAN address 10.0.0.2)<\/strong><\/p>\n

    if [[ $(ps -ef | grep -c vncviewer)  -ne 1 ]];\r\nthen\r\n    echo \"Running\"\r\nelse\r\n   export DISPLAY=:0.0;\r\n    vncviewer -listen 0 -fullscreen -owncmap -viewonly;\r\nfi\r\n<\/pre>\n

    You will need to install VNC Viewer in client side.<\/p>\n","protected":false},"excerpt":{"rendered":"

    You are doomed if your laptop has only one HDMI Port & you\u00a0are running Linux\u00a0in that box. Unlike windows – where there are tons of easy to run solution, & there are still tons of solutions if you have big numbers in your pocket. Certainly – I neither wish to spend money on external VGA\/HDMI … <\/p>\n

    Continue reading<\/a><\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_lock_modified_date":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[3,6,8,1],"tags":[29],"class_list":["post-200","post","type-post","status-publish","format-standard","hentry","category-linux","category-server","category-snippets","category-uncategorized","tag-hack","item-wrap"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack-related-posts":[],"jetpack_shortlink":"https:\/\/wp.me\/pciGs2-3e","jetpack_likes_enabled":true,"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/madhurendra.com\/wp-json\/wp\/v2\/posts\/200","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/madhurendra.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/madhurendra.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/madhurendra.com\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/madhurendra.com\/wp-json\/wp\/v2\/comments?post=200"}],"version-history":[{"count":5,"href":"https:\/\/madhurendra.com\/wp-json\/wp\/v2\/posts\/200\/revisions"}],"predecessor-version":[{"id":212,"href":"https:\/\/madhurendra.com\/wp-json\/wp\/v2\/posts\/200\/revisions\/212"}],"wp:attachment":[{"href":"https:\/\/madhurendra.com\/wp-json\/wp\/v2\/media?parent=200"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/madhurendra.com\/wp-json\/wp\/v2\/categories?post=200"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/madhurendra.com\/wp-json\/wp\/v2\/tags?post=200"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}