DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Last call! Secure your stack and shape the future! Help dev teams across the globe navigate their software supply chain security challenges.

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Releasing software shouldn't be stressful or risky. Learn how to leverage progressive delivery techniques to ensure safer deployments.

Avoid machine learning mistakes and boost model performance! Discover key ML patterns, anti-patterns, data strategies, and more.

Related

  • How to Secure Your Raspberry Pi and Enable Safe, Resilient Updates
  • IoT Needs To Get Serious About Security
  • Recognizing Music Genres With the Raspberry Pi Pico
  • Remote Control With Node.js, React.js, and Raspberry Pi

Trending

  • Building Enterprise-Ready Landing Zones: Beyond the Initial Setup
  • From Zero to Production: Best Practices for Scaling LLMs in the Enterprise
  • Kubeflow: Driving Scalable and Intelligent Machine Learning Systems
  • Beyond Linguistics: Real-Time Domain Event Mapping with WebSocket and Spring Boot
  1. DZone
  2. Data Engineering
  3. IoT
  4. Clean Up Your Workbench With a VNC Server on a Raspberry Pi

Clean Up Your Workbench With a VNC Server on a Raspberry Pi

Avoid having too many input and output devices on your workbench by using a virtual network computing server, and an accompanying viewer, and a Rasbperry Pi.

By 
Erich Styger user avatar
Erich Styger
·
Jan. 01, 17 · Tutorial
Likes (4)
Comment
Save
Tweet
Share
14.6K Views

Join the DZone community and get the full member experience.

Join For Free

The Raspberry Pi is a versatile mini computer. As such, I can use it with a USB keyboard, mouse, and HDMI LCD monitor. But having multiple keyboards and mice on my desktop is not my thing; somehow I always grab the wrong one. So what I prefer is to run the Raspberry with VNC (Virtual Network Computing). That way, I have the Linux GUI as a window on my normal desktop, and no messing up with keyboards and mice:

Raspberry Pi on my Dekstop

Raspberry Pi on my dekstop

VNC is a graphical desktop sharing program. It requires software to be installed on the Linux machine as a server, and as the viewer runs on the other client machine (e.g. Windows), it connects over the network to the server. That way, the input devices and displays of the client machine can be used as if they are attached to the server.

In my setup, the Raspberry Pi is booting to the desktop environment by default.

If you want to check it out, the process of installing VNC on a Raspberry Pi is described in the documentation. To start the server on the Pi, use $ vncserver.

vncserver started

VNC server started

On my laptop, I’m using the free VNC Viewer from RealVNC.

VNC Viewer

VNC Viewer

Connecting

In the client connection settings, I specify the IP address plus the screen number (:1):

VNC Client Connection Settings

VNC client connection settings

 I had problems connecting the client and the server if they were not in the same subnetwork. I did not investigate this further, but I believe it is about which ports are open on the network router. From a security point of view, I’m OK with this.

The address to connect to is shown in the VNC Server:

VNC Server with Address

VNC server with address

Now when the Raspberry Pi gets rebooted, I have to restart the server manually. Here is how to get it started automatically:

Change the director to the user (pi, usually /home/pi/) account directory:

cd ~


In that folder, there should be a .config directory. Change to that one:

cd .config


If it not already exists, create a directory named ‘autostart’:

mkdir autostart


autostart in config

Autostart in config

Change to that directory:

cd autostart


In that folder create (if it does not already exist) a file named tightnc.desktop. It can be created/edited with

nano tightvnc.desktop


Then add the following:

[Desktop Entry]
Type=Application
Name=TightVNC
Exec=vncserver :1
StartupNotify=false


Editing tightvnc.desktop

Editing tightvnc.desktop

Save the content with CTRL-O and then exit with CTRL-X.

That’s it: Reboot Linux, and the VNC server will be running automatically.

Summary

Virtual Network Connection (VNC) with a VNC viewer is a good way to avoid too many input and output devices on a workbench: It allows me to use my desktop display, mouse, and keyboard for the Raspberry Pi. All it requires is a viewer on the desktop and a VNC server running on the Linux machine. To autostart the VNC server, a file (tightvnc.desktop) has to be created.

Happy VNCing!

Links

  • Installation of VNC
  • RealVNC
raspberry pi Workbench (AmigaOS)

Published at DZone with permission of Erich Styger, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • How to Secure Your Raspberry Pi and Enable Safe, Resilient Updates
  • IoT Needs To Get Serious About Security
  • Recognizing Music Genres With the Raspberry Pi Pico
  • Remote Control With Node.js, React.js, and Raspberry Pi

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!