One place for hosting & domains

      Remote

      How To Set Up a Remote Desktop with X2Go on Debian 10


      Not using Debian 10?


      Choose a different version or distribution.

      The author selected Software in the Public Interest (SPI) to receive a donation as part of the Write for DOnations program.

      Introduction

      Usually, Linux-based servers don’t come with a graphical user interface (GUI) preinstalled. Whenever you want to run GUI applications on your instance, the typical solution is to employ Virtual Network Computing (VNC). Unfortunately, VNC is notoriously sluggish, insecure by default, and requires a lot of manual configuration to get up and running.

      By contrast, X2Go provides a working “cloud desktop,” complete with all the advantages of an always-online, remotely-accessible, and easily-scalable computing system with a very fast network. It is also more responsive and more secure than many VNC solutions. In this tutorial, you’ll use X2Go to create a Debian 10 XFCE desktop environment that you can access remotely. This “cloud desktop” will include the exact same utilities that you would obtain had you installed Debian 10 and XFCE environment on your personal computer.

      The setup described in this tutorial is useful when:

      • You need access to a Linux-based operating system, complete with a desktop environment, but can’t install it on your personal computer.
      • You use multiple devices in multiple locations and would like to have a consistent work environment with the same tools, same look, same files, and same performance.
      • Your Internet service provider gives you very little bandwidth, but you need access to tens or hundreds of gigabytes of data.
      • Long-running jobs make your local computer unavailable for hours or days. Imagine that you have to compile a very large project, and it will take 8 hours on your laptop. You won’t be able to watch movies or do anything else very resource-intensive while your project compiles. But if you run such jobs on your server, now your computer is free to perform other tasks.
      • You’re working with a team, and it benefits them to have a common computer that they can access in order to collaborate on a project.

      Prerequisites

      Before starting this tutorial, you’ll need:

      • A Debian 10 x64 instance with 2GB of RAM or more. 2GB is minimal and it’s recommended to use a server with 4GB or more if you have memory-hungry applications you plan to run. You can use a DigitalOcean Droplet if you like.

      • A user with sudo privileges and an SSH key. Follow this guide to get started: Initial Server Setup with Debian 10. Make sure you complete Step 4 and configure your firewall to restrict all connections except for OpenSSH.

      Step 1 — Installing the Desktop Environment

      With your server up and your firewall configured, you are now ready to install the graphical environment for the X2Go server.

      In this tutorial, you are installing XFCE as the desktop environment. XFCE doesn’t use fancy graphical effects like compositing, which makes it more compatible with X2Go and allows it to optimize screen updates. For reference, LXDE and MATE (with compositing disabled) also work fine but you’ll have to change the command in this tutorial where you install the desktop environment. For example, instead of sudo apt-get install xfce4 you would type sudo apt-get install lxde.

      There are two ways to easily install XFCE, but you only need to choose one—either the Minimal Desktop Environment or the Full Desktop Environment.

      Full Desktop Environment: Recommended. If you don’t want to handpick every component you need and would rather have a default set of packages, like a word processor, web browser, email client, and other accessories pre-installed, then you can choose task-xfce-desktop.

      Install and configure the Full Desktop Environment. This is similar to what you would get if you installed Debian from a bootable DVD/USB memory stick to your local PC:

      • sudo apt-get install task-xfce-desktop

      Minimal Desktop Environment: Alternately, if you want to install a small, core set of packages and then build on top of them by manually adding whatever you need afterward, you can use the xfce4 metapackage.

      A metapackage doesn’t contain software of its own, it just depends on other packages to be installed, allowing for an entire collection of packages to be installed at once without having to type each package name individually at the command line.

      Install xfce4 and all of the additional dependencies needed to support it:

      • sudo apt-get install xfce4

      Now that your graphical environment is installed, you will establish a way to view it remotely.

      Step 2 — Installing X2Go on the Server

      X2Go comes with two main components: the server, which starts and manages the graphical session on the remote machine, and the client, which you install on your local computer to view and control the remote desktop or application.

      In previous versions of Debian, x2goserver wasn’t included in the default repositories, so you’d have to follow steps like these to get the software package. You’re leaving the link here, just for reference, in case the package gets dropped in future versions of Debian. Fortunately, Debian 10, codenamed Buster, includes the package you need in its default repositories, so the installation is a bit easier.

      To install X2Go on your server, type the following command:

      • sudo apt-get install x2goserver x2goserver-xsession

      At this point, no further setup is required on your server. However, keep in mind that since SSH password authentication is disabled, for increased security, you’ll need to have your SSH private key available on any machine that you want to log in from. This will be the case if you followed the recommendation of setting up SSH keys in the Initial Server Setup with Debian 10 tutorial listed in the prerequisites. If you didn’t, you can still log in with a password, but make sure you choose a strong one.

      Remember that if you run out of RAM, some applications might be abruptly terminated by the Linux kernel, and then you could lose work in progress. If you are using a DigitalOcean Droplet and you notice that your programs require more RAM, you can temporarily power off your Droplet and upgrade (resize) to one with more memory.

      You are now done setting up the server and you can type exit or close the terminal window. The rest of the steps will focus on configuring the client on your local machine.

      Step 3 — Installing the X2Go Client Locally

      X2Go is ready to use out of the box. If you’re using Windows or Mac on your local machine, you can download the X2Go client software here. If you’re using Debian or Ubuntu you can install the X2Go client with this command on your local machine:

      • sudo apt-get install x2goclient

      After downloading the software you are ready to install it. Open the installer and select your preferred language. Now agree to the license and let the wizard guide you through the remaining steps. Normally, there shouldn’t be any reason to change the pre-filled, default values in these steps.

      X2Go works well out of the box but it is also highly customizable. If you’d like additional information, visit X2Go’s official documentation.

      Now that the desktop client is installed, you can configure its settings and connect to the X2Go server to use your remote XFCE desktop.

      Step 4 — Connecting To the Remote Desktop

      When you first open the X2Go client, the following window will appear. If it doesn’t, click Session in the top-left menu and then select New session ….

      X2Go Client Screenshot - Creating a New Session

      In the Session name field, enter something to help differentiate between servers. This can be particularly useful if you plan on connecting to multiple machines.

      Enter your server’s IP address or hostname in the Host field under Server.

      Enter the username you used for your SSH connection in the Login field.

      And, since you installed XFCE in Step Two, choose XFCE as your Session type.

      Finally, because you are connecting to the server with SSH keys, click the folder icon next to Use RSA/DSA key for ssh connection and browse to your private key. If you didn’t opt to use the more secure SSH keys, just leave this empty and the X2Go client will ask for a password each time you log in.

      The rest of the default settings will suffice for now, but as you get more familiar with the software, you can fine tune the client based on your individual preferences.

      After pressing the OK button, you can start your graphical session by clicking the white box that includes your session’s name on the top-right side of the box.

      X2Go Main Window - Session List

      If you are running OS X on your local machine, you may be prompted to install xquartz, which is required to run X11. If so, follow the instructions to install it now.

      In a few seconds, your remote desktop will be displayed and you can start interacting with it. During your first login, XFCE will ask if you want to Use default config or One empty panel. The first option will create a rectangular panel docked at the bottom of the screen, containing a few useful application shortcuts (e.g. a file manager, a terminal emulator, a browser, etc.). This option will also add a top panel to the desktop that includes utilities like an application launcher, a clock, a shutdown menu, and more.

      Unless you’re already familiar with XFCE, opting for an empty panel can be more complicated because you’ll be starting from scratch. There will be no taskbar, no clock, and no pre-configured start menu; it will be up to you to add everything to an empty panel on your own.

      Additionally, on Windows and Linux-based operating systems, there are a few useful keyboard shortcuts you can use for a better experience:

      CTRL+ALT+F will toggle full-screen mode on and off. Working in full-screen mode can feel more like a local desktop experience. Plus, other keyboard shortcuts will be grabbed by the remote OS instead of the local one.

      CTRL+ALT+M will minimize the remote view, even if you are in full-screen mode

      CTRL+ALT+T will disconnect from the session but leave the GUI running on the server. It’s just a quick way of disconnecting without logging off or closing applications on the server. The same will happen if you click the window’s close button.

      Lastly, there are two ways you can end the remote session and close all of the graphical programs running in it. You can log off remotely from XFCE’s start menu, or you can click the button marked with a circle and a small line (like a power/standby icon) in the bottom-right corner of the main portion of the X2Go screen.

      The first method is cleaner but may leave programs like session managing software running. The second method will close everything but may do so forcefully if a process can’t cleanly exit. In either case, be sure to save your work before proceeding.

      X2Go Main Window - Terminate Session Button

      And lastly, although it’s not required, let’s go into XFCE’s control panel, navigate to power settings and disable all standby features. If you don’t use the desktop for a while, XFCE will try to trigger a standby. Although the server normally won’t do anything when it receives this request, it’s better to avoid any unforeseen behaviors altogether.

      By going to the Applications menu, then Settings, you can open Power Manager.

      Opening XFCE Power Manager

      In this application, navigate to the System tab and drag the When inactive for slider all the way to the left. You should now see the text Never under this slider, which means XFCE won’t try to put the system in standby after it’s inactive for a while.

      Disabling Automatic System Suspend in XFCE Power Manager

      You have now successfully accessed and configured your remote desktop.

      Conclusion

      In this tutorial you used X2Go to create a robust and remote GUI-environment for the Debian operating system. Here are a few additional ideas about how to use this desktop. You could centralize your development work by creating a git repository, installing an IDE/code editor like NetBeans or Eclipse, or configuring a web server for testing web applications. You could also enhance your remote desktop with a good backup scheme to make sure that your work environment and important data are safely preserved in case something ever goes wrong. With DigitalOcean, you can also snapshot your Droplets when you’re happy with a certain setup. This way, you can test risky changes and always come back to a known good state in case you break something.

      If you’d like to learn more, visit X2Go’s official documentation website.



      Source link

      Preparing Your Corporate Network for Emergency Remote Work: Bandwidth, VPNs, Security and Notes for INAP Customers


      The global spread of the novel coronavirus (COVID-19) has organizations large and small readying their office-based staff for temporary remote work. While it’s a wise move for achieving containment, this isn’t as easy as an email sending everyone home for two weeks. Many infrastructure and networking considerations must be accounted and planned for, not the least of which is additional bandwidth to ensure steady application performance.

      In a snap poll by Gartner, 54 percent of HR leaders indicated that poor technology and/or infrastructure for remote working is the biggest barrier to an effective work from home model. IT leaders play an essential role in abating that concern and making any telework policy a success.

      With that in mind, what are the top networking and security considerations for remote work?

      Check out the brief network FAQ below for the most essential points.

      How can I determine if my company needs additional bandwidth?

      Start by looking at your applications. What applications do workers need to effectively do their jobs? How and how often are these applications accessed?

      Good news: If the application is already hosted in the cloud via platform as a service (PaaS) or software as a service (SaaS), you may not have an issue. Workers using Office 365, for example, will still be able to access their important documents and communicate effectively with their teammates via related workflow tools like Microsoft Teams. But even if an application isn’t in the cloud, if workers are on a remote desktop program, the heavy lifting is done in the data center and won’t affect your network.

      Additional bandwidth may be needed if your organization runs frequently used, resource-hungry applications over the corporate network. Common examples are file share systems or home-grown apps that involve rich media or large data sets, like CAD software or business intelligence tools. Access to these will require a VPN, which in turn may require greater bandwidth. (See below) The net amount of new bandwidth needed will be determined by application access and traffic patterns.

      What considerations need to be made to support a greater number of VPN users?

      First, review your license capacity. VPNs are typically licensed per concurrent user. For example, an organization might choose a license for 50 users because the number of remote workers at one time would rarely if ever exceed the cap. With emergency plans, however, that number might suddenly jump to 250.

      Next, look at hardware specs. Firewalls have different capacities for hardware performance. They also have a hard number of users than be supported from a VPN. Check with your VPN provider to make adjustments.

      There are also hardware limits for how many users a VPN can handle. For instance, a new firewall license may be needed if your current limits are insufficient. To update the license, you would need to make a call to your firewall provider to update the number of seats.

      What recommendations should companies make for worker’s home connections?

      The biggest roadblock to smooth remote network connectivity may be largely outside IT’s control: Your end user’s home internet service. In this case, preparation is key. Before a mass migration to remote work, test a representative sample of current remote users’ access to applications to see where you might run into performance bottlenecks. If some employees don’t have access to high-speed internet, discuss business continuity contingencies with senior leadership. Can the company reimburse users for upgrades? If not, how can critical work be done offline?

      What security measures should be considered with sizeable move to remote work?

      While the VPN will provide a secure connection, two-factor authentication ensures the remote users are who they say they are. You should also configure your system to prohibit file storage on users’ home devices, and if possible, prevent VPN access to employees’ home devices altogether by providing company owned endpoints.

      For optimal network security, configure your VPN to prevent split tunneling, which allows for some traffic to route over the protected network and other traffic (such as streaming and web browsing) through the public internet. While this will make all endpoints more secure, preventing split tunneling will require more bandwidth.

      I’m an INAP customer and need more bandwidth. What’s the process?

      If you’re a current INAP customer and already have bandwidth with us, you can check your IP usage here. If needed, you can adjust your commit or your cap limit, depending on how your circuit is set up. Increasing your commits is easy as long as there are no physical changes being made.

      If you have a cap configuration, changes to the rate limit are also simple to make via a logical configuration. While you can remove the cap or increasing the rate limit, be cautioned that this isn’t the most fiscally beneficial move to make, as making a commit will get you a better price.

      If you need to change the physical network topology, such as making a move from a 1 GB to a 10 GB circuit, the process will take additional time. Contact INAP support or your account rep to start the discussion.

      Finally, if you’re an INAP Colocation customer and won’t be able to directly manage your environment at the data center, contact us for adding 24/7 remote hands support.

      I’m looking for a new high-performance bandwidth service. How can I get started?

      Our multi-homed bandwidth service, Performance IP®, is powered by our proprietary route optimization engine, which ensures your outbound traffic reaches end users along the lowest latency path.

      If you’re already collocated in one of INAP’s 100 Global POPs, the turnaround for a cross connect is typically achieved in 1-2 weeks. If a remote connection to your data center is required, contact us for a complimentary solution design consultation.

      Click here to check out our locations or chat now to get started.

      Interested in learning more?

      CHAT NOW

       

      Contributor: Paul Just, INAP Solution Engineer

      Laura Vietmeyer


      READ MORE



      Source link

      How To Use Visual Studio Code for Remote Development via the Remote-SSH Plugin


      Introduction

      Visual Studio Code is a popular Integrated Developer Environment (IDE) for developers. Its large selection of plugins, minimal design, and cross-platform support make it a great choice for developers of all levels. This tutorial focuses on using the Remote-SSH plugin to enable remote software development. With this plugin you can edit files on your local workstation, but run development tasks such as program execution, unit tests, or static analysis on a remote server.

      There are many reasons why this may be beneficial to you. For example, you may have a Windows workstation and want to develop on Windows, but your code will eventually run on Linux. You may need more RAM or processing power than your current machine has available, or you want to keep code off of your personal machine due to a company policy, or the desire to keep your workstation prestine.

      In this tutorial, you’ll enable the Remote-SSH plugin, configure Visual Studio Code to execute code on the remote server, and execute code from your local Visual Studio Code installation on the remote server.

      Prerequisites

      In order to follow along with this guide, you’ll need:

      • A local development machine running Windows, MacOSX, or Linux. This tutorial will not work on ChromeOS devices.
      • Visual Studio Code, which you can download and install from the official web site.
      • An SSH key pair generated:
      • One Ubuntu 18.04 server set up by following the Ubuntu 18.04 initial server setup guide, including a non-root sudo-enabled user and a firewall.

      Step 1 — Installing the Remote-SSH Plugin

      The Extensions Marketplace is where you can download supported and third-party extensions for a variety of different tools and programming languages. This is where you will search for the Remote-SSH plugin and install it.

      On the left-hand side of the IDE there is a vertical row of five icons. The bottom icon, which looks like four squares in a box with the top right square exploding out, is the icon for the Extensions Marketplace:

      Extensions Marketplace Icon Location

      You can also access this section by pressing Ctrl+Shift+X. When you open this page you will see suggested plugins to download and install.

      Once you have the Extensions Marketplace open, type Remote-SSH in the Search Extensions in Marketplace search bar. When you find the plugin, select it and then click the green Install button to install the extension.

      Search for the Remote SSH Plugin

      The extension is now installed. Next, you’ll configure the extension so you can connect to your server.

      Step 2 — Configuring the Remote-SSH Plugin and Connecting To Your Server

      Now that you have the plugin installed you can configure it to connect to a server. To do so, you’ll need the following pieces of information:

      • The server’s IP or hostname.
      • The username you’ll connect with.
      • The private key you’ll use to authenticate your user.

      You’ll use this information to create an SSH configuration file that Visual Studio Code can use to SSH to the server to sync files and execute code on your behalf. You will create this configuration using Visual Studio Code.

      Now that you have the Remote-SSH plugin installed, you’ll see a small green box in the bottom left-hand corner of the Visual Studio Code interface. If you hover over the box with your mouse pointer, the popup will say Open a remote window. The button looks like a greater than sign slightly under a less than sign ><, like the one in the following image:

      Open a remote window green UI button

      Click the button, and a dialog box appears in the top center. Select Remote-SSH: Open Configuration File… from the list:

      Selecting Configure SSH in the UI

      The next prompt will ask you which configuration file you want to open. If you’re on Windows, you’ll see two locations: one in your personal user directory, and one in the installation location for SSH. You should use the file in your user directory when configuring the server.

      Select the file and your editor will open the config file. Add the following code to the file to define the connection to your server, replacing the highlighted sections with the information for your server:

      config

      Host my_remote_server
          HostName your_server_ip_or_hostname
          User sammy
          IdentityFile /location/of/your/private/key
      

      Here’s how this configuration file works:

      • Host: This specifies a name for your host. This lets you use a short name or abbreviation instead of the full IP address or host name when connecting to the server.
      • HostName: The actual hostname of the server, which is either an IP address or a fully qualified domain name.
      • User: The user you want to use to connect with.
      • IdentityFile: The path to your SSH private key. On Mac and Linux systems, you’ll find this in your home directory in a hidden .ssh directory, typically called id_rsa. If you are on Windows you will have specified a location to save this file when you created it using putty-gen.

      Specify the appropriate values in your file and save the file.

      Visual Studio Code is now configured and ready to connect to your server. Click on the green Open a remote window button in the bottom left-hand corner and select Remote-SSH: Connect to Host…

      Connecting to the Server from Visual Studio Code

      Once you’ve done this all the availble and configured servers will appear in the dropdown menu. Select the server that you want to connect to from this list.

      If this is the first time you have connected to this server from your machine, you’ll likely be prompted with the SSH Fingerprint verification dialog, like the one in the following image:

      Confirming your SSH Fingerprint

      This is to ensure that you are really connecting to the server you think you are. You can verify this by logging in to your server manually and running ssh-keygen -l -f /etc/ssh/ssh_host_key.pub to view the fingerprint of the server. If this fingerprint is the same as the one being presented to you in Visual Studio Code, then you are indeed connecting to the server you think you are so you can click Continue.

      Visual Studio Code defaults to opening a new window when a new connection is made. A new window will appear with the welcome screen. You’ll know that your connection was successful if you see SSH: your_ip_address_or_hostname in the green box in the bottom left-hand corner. This means that Visual Studio Code is connected and communicating with your remote server.

      Successful SSH connection

      Now that you’re connected, you can run commands and code from your editor.

      Step 3 — Executing Code on the Remote Server

      The Remote-SSH plugin is configured, and it’s time to run some code on your remote machine. Open a terminal window by selecting Terminal from the navigation bar at the top of the Visual Studio window and clicking New Terminal. You can also open a terminal by pressing CTRL+Shift+`. The terminal that is opened is a terminal on your remote server, not one on your local machine.

      When the terminal opens, issue the following command to view the IP address of your server to verify that you are connected to your remote server:

      You’ll see the following output in your terminal:

      Output

      1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000 link/ether 16:cb:05:5b:30:f1 brd ff:ff:ff:ff:ff:ff inet your_server_ip brd your_broadcast_address scope global eth0 valid_lft forever preferred_lft forever ...

      To test out the ability to run remote code, create a new Python file called hello.py in your editor. When you are connected to your remote server, all files created through Visual Studio Code will be saved to that server, not on your local machine.

      Add the following contents to the file:

      hello.py

      print("Hello Sammy!")
      

      To run this program on your server, open a terminal in Visual Studio Code from the navigation menu or by pressing the key sequence CTRL+Shift+`. Since this terminal session is connected to your remote server, run the following command in the terminal to execute your hello.py program:

      Your program’s output will be displayed.

      Executing your Python Script

      You can also execute the file from the Debug context menu by selecting Run without Debugging.

      Note: If you have any development extensions installed in Visual Studio Code, like the Python extension, you will have to reinstall these extensions on your server through the Extension Marketplace. If you have previously installed these plugins in Visual Studio Code, when you search for them again, the Marketplace will say Install on SSH: hostname. Always pay attention to what devlopment context you are in, because this is where Visual Studio Code will install your plugins and create your files. If you try to run your code without these plugins installed, error dialog boxes will appear in the bottom right-hand corner of the screen prompting you to install them on your remote server. After you have installed these they will likely require you to reload Visual Studio Code. When you relaunch it, it will continue working on the remote server without you having to manually reconnect.

      Conclusion

      You now have Visual Studio Code configured for development on a remote server using SSH. Remote execution with an IDE provides many benefits, including the ability to quickly test how your code runs on different operating systems and different hardware specifications. As long as you have an internet connection you could connect to your server and work on your code from any computer, and you’ll be able to develop using a Linux environment even if you run Windows as your primary operating system.



      Source link