Hosts File Editing

The need to edit the hosts file is determined by the operating system:

  • On a Linux or Linux-based (e.g., Raspberry Pi) computer acting as the remote server, the /etc/hosts file must be updated to associate the computer name with its current IP address. If this is not done then the remote machine may not give permission for the host, running MPLAB® X IDE, to connect to the remote server.
  • On a Windows OS computer acting as the remote server, editing the hosts file may or may not need to be done.

Linux OS

The remote machine name can be retrieved through a console window using the hostname command. The IP address can be found by using the /sbin/ifconfig command or from the Server IP Address field in the MPLAB Remote USB Communications Server application.

An example of an updated hosts file is shown in the example below. For a remote machine named MyLinux42 and an IP address of, the content of the hosts file has been edited to add line #2.

Example: Hosts File Update       localhost  MyLinux42

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

This file will need to be edited using root privileges. For example, using a Vim editor:
$ sudo vim /etc/hosts

Windows OS

In some instances, when running the remote server application in a Windows system, you may need to edit the Windows equivalent of the Linux hosts file. This is especially true if the Server Name and the Server IP Address are the same.

The Windows hosts file may be found at C:\Windows\system32\drivers\etc\hosts.

You will need administrative privileges to edit this file. For more information, see How to Edit the Hosts File.

© 2021 Microchip Technology, Inc.
Notice: ARM and Cortex are the registered trademarks of ARM Limited in the EU and other countries.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.