Host/Target Setup and Configuration#

This topic describes how to set up the networking between the host system and the target system, as well as target user account setup and environment for cross-compilation.

DriveOS Linux ships with an application that allows the end user to set up a user account using wizard prompts in the UART interface. When the target device boots for the first time after flashing, it automatically runs OEM-config.

Note

  • OEM-config is not available in production SDK file systems including driveos-prod-rfs and driveos-prod-debug-rfs. If any of these file systems are flashed, you can log in by providing a username (nvidia) and password (nvidia).

  • To change user account information, such as username or password, or to add more user accounts, follow the steps described in the other sections of this topic to manage user accounts.

Before the target system boots for the first time, you must start a serial application on the host computer. For more instructions, check the Terminal Emulation section.

Note

  1. If you are using dev_nsr_desktop_rfs and have a display connected to the target, a Graphical User Interface (GUI) setup wizard is launched on the display. When OEM-Config is running in the display, the UART displays the message``OEM-CONFIG RUNNING IN DISPLAY`` until the GUI OEM-Config is completed.

  2. If you are not using dev_nsr_desktop_rfs or do not have a display connected, then OEM-Config runs directly in UART.

Note

  1. DriveOS LINUX dev_nsr_desktop rootfs starts GUI Oem-Config by default if the display is connected. However, it assumes that: 1. The DriveOS platform has a display connected, and it is accessible to the user to see the display. 2. The DriveOS platform has input devices connected, and it is accessible to the user to provide inputs to the GUI Oem-Config application.

  2. Thus, ensure both display and input devices are connected and accessible to the user.

GUI-based DriveOS Linux Configuration on the Target#

Use the following steps to set up the DriveOS Linux configuration on the target display:

  1. Allow the system to power on and boot up the operating system.

After the operating system boots, OEM-config starts and splashes the user interface on the display connected to the target with the welcome screen as shown below:

1. To proceed with OEM-Config to display the EULA, click **Continue**.
2. To remain at the same screen, no action is required.

image1

  1. After the EULA appears, scroll to read the entirety of the EULA. 1. To accept the EULA, select Yes and click Continue. 2. To reject the EULA, select No and click Continue. This shuts down the system safely.

image2

  1. Follow the OEM-Config prompt to set up the first user in the system. The first user account is always an administrator account that can run sudo commands.

You can set up additional users at the end of the wizard.

1. Enter the full name of the first user.
2. Enter the first user's username.

Note: A valid username must satisfy this regular expression (regex) ** 1[a-z0-9_-]{0,31}$** , and OEM-config rejects invalid usernames.

The above regex expresses the username with the following conditions: 1. The username must not be empty. 2. The username must start with either a lowercase letter or an underscore (*). 3. The second and subsequent characters can be a lowercase letter, number, underscore (*), or hyphen (-). 4. The username must be fewer than or equal to 32 characters in length.

3. Enter a password of your choice and re-enter the same password to confirm. The password must be made of ASCII characters.
  1. A weak password has less than 8 characters.
  2. You may choose to proceed with a weak password; however, it is not recommended.

image3

  1. Follow the OEM-Config prompt to enable or disable the secure login feature as shown below.

The secure login feature from NVIDIA DriveOS provides better security for SSH connections by using ECDSA-based algorithms. It is recommended that you enable the secure login feature. 1. To enable the feature, select Yes and click Continue. 2. To disable the feature, select No and click Continue.

image4

  1. You are then prompted to set up any additional users for the system. If you do not wish to setup any additional users, click Continue. Otherwise, click Add User.

image5

  1. If you decide to add additional users, the following prompt appears. Otherwise, please proceed to step 9. 1. Select Admin for a user who has permission to run sudo commands. 2. Select NonAdmin for standard users.

When you have made your selection, click Next.

image6

  1. Enter the full name, username, and password for this user. 1. Enter the full name of this user. 2. Enter this user’s username.

You may not select a username which is used by the primary user, or any other users you have already created. OEM-Config rejects usernames that are already taken.

Note: A valid username must satisfy this regular expression (regex) ** 2[a-z0-9_-]{0,31}$** , and OEM-config rejects invalid usernames.

The above regex expresses the username with the following conditions: 1. The username must not be empty. 2. The username must start with either a lowercase letter or an underscore (*). 3. The second and subsequent characters can be a lowercase letter, number, underscore (*), or hyphen (-). 4. The username must be fewer than or equal to 32 characters in length.

3. Enter a password of your choice and re-enter the same password to confirm. The password must be made of ASCII characters.
  1. A weak password has less than 8 characters.
  2. You may choose to proceed with a weak password; however, it is not recommended.
4. Click **Done** to proceed.

image7

  1. You return to the screen below. 1. You may continue adding as many secondary users as you like (Admin or NonAdmin) by clicking Add User again and repeating steps 5 – 7.

2. If you are done adding users, click **Continue**.

image8

  1. When you see the prompt shown below, OEM-Config now has all the information it needs to configure your system. 1. Click Continue to configure this system. 2. Do not shut down the system.

image9

  1. When you see the prompt shown below, OEM-Config has finished configuring your system. You can now select Continue to exit to the target desktop.

image10

Serial/UART-based DriveOS Linux Configuration on the Target#

Use the following steps to set up the DriveOS Linux configuration on the target:

  1. Allow the system to power on and boot up the operating system.

After the operating system boots, OEM-config will start and splash the user interface on the terminal with the welcome screen as shown below. If the OEM-config window does not appear, press the Enter key to refresh the screen, and the following prompt appears:

A screenhot of the DRIVE OS Linux Setup Wizard asking 'Would you like to continue setup?'
* To proceed with OEM-config to display the EULA, use the **Tab** key to move to **< Yes>**, and then press **Enter**.
* To remain at the same screen, use the **Tab** key to move to **< No>**, and then press **Enter**.
  1. After the EULA appears, use the <PgUp > and <PgDn > keys to scroll up and down when reading the EULA.

The DRIVE OS Linux Setup Wizard welcome message.

After reading the EULA, use the Tab key to move to < Ok>, and then press Enter to proceed to the acceptance of the EULA as follows:

A screenshot of the DRIVE OS Linux Setup Wizard displaying a progress bar, indicating the installation of DRIVE OS components.
* To accept the EULA, use the **Tab** key to move to **< Yes>** and press **Enter** to proceed.

To proceed to the next step, accept the EULA.

* To reject the EULA, use the **Tab** key to move to **< No>**, and then press **Enter** to shut down the system safely.
  1. Follow the OEM-config prompt to set up the first user in the system. The first user is always the administrator account (who can run the sudo commands).

The OEM-config will prompt you later to add more user accounts with the account type of non-administrator or administrator.

A screenshot of the DRIVE OS Linux Setup Wizard with a progress bar and a 'Reboot' button, indicating the system is ready to restart.

Press the Enter key to continue to set up the first user account.

  1. Enter the full name of the first user, and then press Enter to continue.

A screenshot of the DRIVE OS Linux Setup Wizard prompting for the full name of the new user, with 'driveos' already entered.
  1. Enter the first user’s username.

A valid username must satisfy this regular expression (regex) ^[a-z_][a-z0-9_-]{0,31}$, and OEM-config rejects invalid usernames.

The regex validates the username with the following conditions:

* The username must not be empty.
* The username must start with either a lowercase letter or an underscore (_).
* The second and subsequent characters can be a lowercase letter, number, underscore (_), or hyphen (-).
* The username must be fewer than or equal to 32 characters in length.
A screenshot of the DRIVE OS Linux Setup Wizard prompting for the username for the new account, with 'driveos' already entered.
  1. Enter a password of your choice and re-enter the same password to confirm. The password must be made of ASCII characters.

A screenshot of the DRIVE OS Linux Setup Wizard prompting for a password for the new user.
A screenshot of the DRIVE OS Linux Setup Wizard confirming the new user settings and providing a Reboot option.
  1. After entering a password, use the Tab key to move to < Yes>, and then press Enter to proceed.

A screenshot of the DRIVE OS Linux Setup Wizard displaying a warning about using a weak password and prompting for confirmation

If the password created in step 6 is weak (for example, fewer than eight characters as shown in the preceding figure), the system recommends that you change the password with a warning message. To change the password, use the Tab key to move to < No>, and then press Enter to go back to step 6.

  1. Follow the OEM-config prompt to enable or disable the secure login feature as shown in the following figure.

The secure login feature from NVIDIA DriveOS provides better security for SSH connections by using ECDSA-based algorithms. It is recommended that you enable the secure login feature.

* To enable the feature, use the **Tab** key to move to **< Yes>**, and then press **Enter**.
* To disable the feature, use the **Tab** key to move to **< No>**, and then press **Enter**.
A screenashot of the DRIVE OS Linux Setup Wizard prompting whether to enable the Secure Login Feature
  1. Follow the OEM-config prompt to add more users.

    • To add more users, use the Tab key to move to < Yes>, and then press Enter.

    • Otherwise, use the Tab key to move to < No>, and then press Enter.

A screenshot of the DRIVE OS Linux Setup Wizard asking if the user would like to add another user.
  1. (Optional) If you choose to add more user accounts in step 9, OEM-config prompts you to choose the type of user for the new user account: admin or non-admin.

* To choose the administrator account, use the **Tab** key to move to **Admin** , and then press **Enter**.
* To choose the non-administrator account, use the **Tab** key to move to **NonAdmin** , and then press **Enter**.
A screenshot of the DRIVE OS Linux Setup Wizard asking to select the type of user account to add.
  1. OEM-config setup is complete. Press Enter to exit the OEM-config screen to display the target command prompt.

A screenshot of the DRIVE OS Linux Setup Wizard displaying a warning message instructing the user not to sut down the system.

Note: If OEM-config is interrupted by powering off the board or resetting the board on step 11 or before, your inputs are not recorded, and you must start over from step 1.

  1. To enable OEM-config to provide information before executing steps in the backend to configure the system based on your inputs, press Enter to proceed.

A screenshot of the DRIVE OS Linux Setup Wizard indicating that the OEM-config has completed setting up the system and prompting the user to press 'Ok' to boot.

DriveOS Linux User Management#

Warning: Whenever any change is made to the filesystem such as adding/modifying/removing user login information, ensure that all data is saved prior to resetting. Execute a software shutdown command, such as halt, shutdown, or reboot to the target system to avoid data corruption; otherwise, file system corruption may occur. Once the target system is shut down, you may use physical/electrical shutdown or reset commands, such as tegrareset or aurixreset in the AURIX command terminal.

NVIDIA DriveOS Linux uses standard Ubuntu tools to manage user accounts. Only admin-users (such as sudoers or root user) can change user accounts. The following steps assume that you are an admin user. Enter the password of your current user.

Steps to Change the Username and Password#

The following steps describe how to change your username and password in the DriveOS Linux filesystem.

Warning: Whenever any change is made to the filesystem such as adding/modifying/removing user login information, ensure that all data is saved prior to resetting. Execute a software shutdown command, such as halt, shutdown, or reboot to the target system to avoid data corruption; otherwise, file system corruption may occur. Once the target system is shut down, you may use physical/electrical shutdown or reset commands, such as tegrareset or aurixreset in the AURIX command terminal.

Changing the Username#

  1. Enable administrative account.

    • Enable the root administrative account by setting a password for the root account. Use the following command to set a password for root account. You will be prompted for the password of your current user.

$ sudo passwd
  1. Close existing user sessions.

    • Log out of all sessions, including GUI and consoles of the user that you are changing the username for. You cannot change the username if a session is still alive.

    • Use the following command to exit console sessions:

$ exit
  1. Log into the system as root account.

    • After completing step #2, you will be presented with a login prompt. Proceed to log in using the credentials you established for the root account.

  2. Change the username.

    • Change the username of the user from ${USERNAME1} to ${USERNAME2} with the following commands:

$ usermod -m -d /home/${USERNAME2} -l ${USERNAME2} ${USERNAME1}
$ groupmod -n ${USERNAME2} ${USERNAME1}
* Log out of the root account using the following command:
$ exit

You have successfully changed the username. Proceed to log in with the new username.

Changing the Password#

Note: When changing the password for the current user, enter the command without sudo as listed below. Entering sudo passwd changes the password for the root user.

  1. Enter the following command to update password.

$ passwd

Enter your existing password and enter the new password.

Changing password for <user>.
(current) UNIX password:
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully.
  1. Enter the current password and then the new password.

Adding a Non-Admin User#

  1. Execute adduser with the new username as input and fill in the information when prompted.

$ sudo adduser <user>

Note:

Non-Admin users can be added to specific groups to get privileged access to components that are otherwise accessible only if the user is root. See Common Groups used in DriveOS Linux Filesystems.

Ensure the Non-Admin user is not added to the sudo or adm group, as this will allow them to run any commands using sudo.

  1. Execute usermod to add the user to the required groups as per the use case requirements of the user.

$ sudo usermod -aG <groups> <user>

Example#

$ sudo adduser test
Adding user `test' ...
Adding new group `test' (1001) ...
Adding new user `test' (1001) with group `test' ...
Creating home directory `/home/test' ...
Copying files from `/etc/skel' ...
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Changing the user information for test
Enter the new value, or press ENTER for the default
        Full Name []:
        Room Number []:
        Work Phone []:
        Home Phone []:
        Other []:
Is the information correct? [Y/n] Y

Adding an Admin User#

  1. Create a non-admin user <user> by following the instructions in the section Adding a Non-Admin User.

  2. Make the created user <user> an admin user by adding the user to all the groups specified in Common Groups used in DriveOS Linux Filesystems following the instructions in the section Adding a Non-Admin User above.

Common Groups Used in DriveOS Linux Filesystems#

Group

Description

adm

Group adm is used for system monitoring tasks. Members of this group can read many log files in /var/log.

audio

This group can be used to give a set of users, access to sound devices. (e.g., sound timers)

dialout

Members of this group gets full and direct access to serial ports.

plugdev

Allows members to mount (only with the options nodev and nosuid, for security reasons) and umount removable devices through pmount.

sudo

Members of this group can execute any command with sudo (/etc/sudoers)

video

This group can be used to give a set of users access to a video device (like the framebuffer, the videocard or a webcam).

Users may require to be added to this group to run DriveOS graphics samples.

debug

This group can be used to give a set of users, access to profile and debug data for GPUs in the system.

Removing a User#

The steps to remove an admin or non-admin users are identical. Removing users using the steps below also removes their /home/<user> directory.

To remove a user, enter:

$ sudo deluser --backup --remove-home <user>

This backs up and creates a tarball (<user>.tar.bz2) of the deleted user data in the current working directory.

Setting Password as an Admin User#

As admin-users are sudoers, they can set the password of any user account with username <username> using the command below. Enter the password of your current user.

$ sudo passwd <username>
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully.

Updating a Password as a Non-Admin User#

Note: When changing the password for the current user, enter the command without sudo as listed below. Entering sudo passwd changes the password for the root user.

Non-admin users can only update their own passwords. The steps below update your user account’s password:

  1. Enter the following command:

$ passwd
  1. Enter your existing password and enter the new password.

 Changing password for <user>.
(current) UNIX password:
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully.
  1. Enter the current password and then the new password.

Disabling a User Account#

The following step allows an admin user to disable the user account with a username $USER:

$ sudo usermod --expiredate 1 $USER

Disabling the user account ensures that the account is unusable in any context in the filesystem. The disabled user ($USER) can be re-enabled with the following command:

$ sudo usermod --expiredate "" $USER

Disabling the Secure Login Feature#

Disabling Secure Login Feature (SLF) removes DriveOS security SSH server config and replaces it with stock Ubuntu SSH server config. There are two (2) options to disable the secure login feature:

  1. If the user wants to disable the SLF, the first option is available during the target setup process using OEM-config and choosing No for the following prompt:

Would you like to enable or disable the Secure Login Feature?
  1. The second option is to manually copy the Ubuntu stock SSH server config to the system’s SSH server config: 1.

sudo cp /usr/share/openssh/sshd_config /etc/ssh/sshd_config
sudo systemctl restart ssh

If the user wants to re-enable SLF after the steps above, copy the DriveOS security SSH server config to the system and restart SSH server.

sudo cp /etc/nvidia/configs/sshd_config.driveos /etc/ssh/sshd_config
sudo systemctl restart ssh

DriveOS Linux SSH Server#

The shipped NVIDIA DriveOS LINUX filesystem driveos-oobe-rfs contains SSH server. However, driveos-core-rfs does not include SSH server. Use the steps below to install SSH server.

Install/Update SSH Server#

  1. Ensure platform is connected to the internet

  2. Update the existing apt database:

# apt-get update
  1. Install SSH server package:

# apt-get install ssh
  1. When prompted by apt-get (see prompt below), choose the option keep the local version currently installed to ensure DriveOS SSH configuration is applied.

Setting Up SSH Server Service#

After SSH server is available in the filesystem, use the steps below as root user to start and configure SSH server service to run on every boot:

  1. Remove the stamp file to unblock SSH server:

$ sudo rm -f /etc/ssh/sshd_not_to_be_run
  1. Start SSH server service on the current boot:

$ sudo systemctl start ssh
  1. Start service to add SSH host-keys to the target:

$ sudo systemctl start nv_ssh_host_keys

After completing the steps above, the SSH server service is started. Additionally, it runs on every boot. SSH clients may now connect to this SSH server.

SSH Server Configuration File#

NVIDIA DriveOS Linux contains an SSH server configuration file sshd_config that pre-configures the following:

  • Permits only connections with Elliptic Curve Digital Signature Algorithm (ECDSA) host key.

  • Disables compression.

  • Permits specific key exchange, host signature, and session encryption algorithms.

NVIDIA DriveOS Linux recommends that you configure strong security options for the following SSH parameters:

  • Client Verification via key exchange: Parameter KexAlgorithms from sshd_config to set the supported key type(s) for client verification.

  • Host Signature: Parameter HostbasedAcceptedKeyTypes from sshd_config to set the supported key type(s) for host verification.

  • Session Encryption: Parameter Ciphers from sshd_config to set the supported SSH session encryption algorithm(s).

The table below suggests recommended strong values to enable recommended security features; the default option is highlighted in the table below.:

Option

Client Verification

Host Signature

Session Encryption

1

ecdh-sha2-nistp256

ECDH [SP 800-56A] over secp256r1 [SEC2-V2] with SHA-256 [FIPS 180-4]

ecdsa-sha2-nistp256-cert-v01@openssh.com

ECDSA [FIPS 186-4][ANS X9.62] over secp256r1 [SEC2-V2] with SHA-256 [FIPS 180-4]

aes128-gcm@openssh.com

GCM [SP 800-38D] with AES-128 [FIPS 197]

2

ecdh-sha2-nistp384

ECDH [SP 800-56A] over secp384r1 [SEC2-V2] with SHA-384 [FIPS 180-4]

ecdsa-sha2-nistp384-cert-v01@openssh.com

ECDSA [FIPS 186-4][ANS X9.62] over secp384r1 [SEC2-V2] with SHA-384 [FIPS 180-4]

aes256-gcm@openssh.com

GCM [SP 800-38D] with AES-256 [FIPS 197]

3

(Default)

ecdh-sha2-nistp521

ECDH [SP 800-56A] over secp521r1 [SEC2-V2] with SHA-512 [FIPS 180-4]

(Default)

ecdsa-sha2-nistp521-cert-v01@openssh.com

ECDSA [FIPS 186-4][ANS X9.62] over secp521r1 [SEC2-V2] with SHA-512 [FIPS 180-4]

(Default)

aes256-gcm@openssh.com

GCM [SP 800-38D] with AES-256 [FIPS 197]

Switching Options in the SSHD Configuration File#

DriveOS Linux contains the snippets for all three (3) options with exactly one option (option 3) enabled as shown below. The options 1, 2, and 3 are mutually exclusive and exactly only one option can be active at a time.

# option 1
# Use algorithms as per DRIVE recommended options: 1,2, or 3
#KexAlgorithms ecdh-sha2-nistp256
#HostbasedAcceptedKeyTypes ecdsa-sha2-nistp256-cert-v01@openssh.com
#Ciphers aes128-gcm@openssh.com
# option 2
#KexAlgorithms ecdh-sha2-nistp384
#HostbasedAcceptedKeyTypes ecdsa-sha2-nistp384-cert-v01@openssh.com
#Ciphers aes256-gcm@openssh.com
# option 3 (default)
KexAlgorithms ecdh-sha2-nistp521
HostbasedAcceptedKeyTypes ecdsa-sha2-nistp521-cert-v01@openssh.com
Ciphers aes256-gcm@openssh.com

To switch from one option to another#

  1. Comment out the three (3) lines corresponding to the current option.

  2. Uncomment the three (3) lines corresponding to the new option.

  3. Restart SSHD using the command below as the root user:

$ sudo systemctl restart ssh

As an example, assume that the current option is option 3 (from the snippet above).

To switch to option 2, execute the following steps:#

  1. Comment out the three (3) lines following # option 3.

  2. Uncomment the three (3) lines from the line below # option 2 until the line above # option 3.

  3. Restart SSHD using the command below as the root user:

$ sudo systemctl restart ssh
  1. SSHD now uses encryption algorithms from option 2.

SSH Key-Based Authentication from Clients to Server#

DriveOS Linux shipped SSHD tries key-based authentication first and falls back to password-based authentication when the former is unavailable. The following sections describe how to set up a user-specific authentication key, add it to the list of trusted-keys, and use the key to authenticate (instead of the password) to the SSH server.

Create a new key-pair at the client side#

The first step is to create a public/private key pair using the command:

$ ssh-keygen -t ecdsa

Continue through the prompts by pressing ENTER and these steps save the key to ~/.ssh.

Set up the server side to register key#

The next step is to add the contents of the client (user-specific authentication) public key ~/.ssh/id_ecdsa.pub into the text file ~/.ssh/authorized_keys.

Use the new key at the client side to connect to the server#

Only the user who created the key can log in to the SSHD server (using the registered keys). At the client side, connect to the server using the ssh command:

$ ssh <user>@<target_ip>

The setup done above is one-directional (i.e., from client to server). To similarly setup in a reverse direction (i.e., from server to client), the above steps must be swapped with regards to client/server and executed to setup key-based authentication from the server to client-side.

Enabling VNC Remote Access#

To install/run x11vnc:

$ sudo apt update
$ sudo apt install x11vnc

VNC command when running X server manually:

$ sudo x11vnc -display :0 -noxrecord -noxfixes -noxdamage -forever -loop –nopw

VNC command when running full desktop:

  1. Configure the target desktop for auto login:

$ sudo vi /etc/gdm3/custom.conf
  1. Uncomment/edit the following lines as shown below:

# Enabling automatic login
  AutomaticLoginEnable = true
  AutomaticLogin = <user>
  1. Save/exit the file and restart the gdm service:

$ sudo systemctl restart gdm3.service
  1. Start the VNC server:

$ sudo x11vnc -display :0 -noxrecord -noxfixes -noxdamage -forever -loop -nopw -auth /run/user/1000/gdm/Xauthority

Setting Up Networking on the Host and Target#

Use the information in this topic to set up the network between an Ubuntu host and your NVIDIA DRIVE® platform. The steps to set up networking includes configuring the DHCP and NFS servers, configuring networking on the host computer, etc.

Configuring the Network Interface#

Configuring the network interface for your device requires:

  • Connecting the board to the host Linux development system.

  • Configuring the network interface.

Warning

To avoid auto detection conflicts with the adapter, do not configure these items with the network manager.

Connecting the Target to the Host Using the Network Interface#

You can connect your target board to the Linux Ubuntu host machine using a private LAN. This private LAN is not the LAN connecting the host to the Internet. Connect through the onboard 1Gb Ethernet connector.

Using Onboard H-MTD Connector to Connect Board and Host on Private LAN#

Tip

Follow the Hardware Quick Start Guide for more detailed descriptions and illustrations.

  1. To use onboard 1Gb Ethernet, select a 1GB-T1 Ethernet port as per the Hardware Quick Start Guide, the Mechanical Guide, and the NVIDIA DriveOS Installation Guide.

  2. Connect the 1GB-T1 selected H-MTD splitter port to the FAKRA connector on the 1GB-NIC adapter provided with the Development Kit package.

  3. Obtain a CAT-6 crossover patch cable and plug one of the RJ45 male ends into the RJ45 connector on the 1GB-NIC adapter.

  4. Plug the other male end of the CAT-6 crossover patch cable into the RJ45 port of the host machine or to the RJ45 port of the USB-to-Ethernet adapter, for example a D-Link DUB-E100 (smsc95xx), connected on your host machine.

Note

The 1GB-NIC adapter can be powered by either the Development Kit U1 or U3 USB-C ports if not used or powered by an external USB power source.

Configuring the Private LAN to the Target Network#

Use the following procedure to configure the host interface for the private LAN connected to the target platform. The procedure assumes eth1 is the Ethernet port on the host PC connected to the NVIDIA board.

Configuring the Private LAN to the Target#
  1. Determine which host eth<n> port is connected to the target, where <n> is the port instance:

    1. Find the eth device by running the following command:

      $ dmesg | grep -i eth
      
    2. In the grep results, identify the eth<n> port for the D-Link DUB-E100 (smsc95xx) or similar USB Ethernet adapter.

      For example, the following dmesg result indicates that the eth1 port is connected to the target:

      [1310932.166153] smsc95xx 2-5.1:1.0: eth1: register
      'smsc95xx' at usb-0000:00:1d.7-5.1, smsc95xx USB 2.0
      Ethernet, 00:04:4b:1b:32:6b
      
  2. On the host, find and edit the following file:

    /etc/network/interfaces
    

    This file is read-only, so you must open it with administrative privileges, for example:

    $ sudo vim /etc/network/interfaces
    
  3. Depending on your connection at the host, modify the interfaces file:

    • Additional NIC card/adapter:

      Add the following to the interfaces file:

      auto eth1
      iface eth1 inet static
          address 10.0.0.1
          netmask 255.255.255.0
      
    • USB Ethernet adapter:

      Add the following to the interfaces file:

      auto eth1
      allow-hotplug eth1
      iface eth1 inet static
          address 10.0.0.1
          netmask 255.255.255.0
          post-up /etc/init.d/isc-dhcp-server restart
      
  4. Restart the host’s networking by running the following command:

    $ sudo /etc/init.d/networking restart
    
  5. Hard reboot the host system.

Configuring the DHCP and NFS Server on the Host#

The DHCP server on the host is used to assign the IP address to the target system and the NFS server is used to mount the root file system on the NVIDIA target system using NFS.

If the DHCP and NFS servers are not yet installed on the host, the installer installs and configures them. Alternatively, those servers can be installed and configured as follows.

To set the DHCP server#

  1. Install the DHCP server on the host:

sudo apt-get install isc-dhcp-server
  1. Specify the interface on which the server should listen for leasing an IP address from the target over the private LAN.

    • Locate and edit the following file:

/etc/default/isc-dhcp-server

This file is read-only, so you must open it with administrator privileges.

* Modify the isc-dhcp-server file to set INTERFACES to the eth<n> connection you determined when connecting your network interface.

For example, add the following line if the DHCP server should listen on eth1 interface.

INTERFACES="eth1"

Changing the interface to “eth3” can result in the following error:

udevd[148]: error changing net interface name eth0 to eth3:
Device or resource busy

To resolve this error, delete the /etc/udev/rules.d/70-persistent-net.rules file.

  1. Configure your host DHCP server for the target interface.

    • Locate and edit the following file:

/etc/dhcp/dhcpd.conf

Because the file is read-only, open it with administrator privileges.

* Modify the dhcpd.conf file to contain the following:
ddns-update-style none;
allow bootp;
subnet 10.0.0.0 netmask 255.255.255.0 {
      option routers 10.0.0.1;
      option domain-name <domain_name>;
      option domain-name-servers <DNS1>, <DNS2>, ... ;
      default-lease-time 345600;
      max-lease-time 31557600;
      range 10.0.0.2 10.0.0.254;
      option root-path "10.0.0.1:/${NV_WORKSPACE}/drive-linux/filesystem/targetfs,wsize=8192,rsize=8192,v3";
}

Where:

* `<domain_name>` is your company domain name.

* `<DNS1>`, `<DNS2>` are the DNS servers that you already added to the `/etc/resolv.conf` file on your host system. Multiple DNS servers are separated by commas. For example, the Google public DNS IP addresses are formatted as:
8.8.8.8, 8.8.4.4
  1. Restart the DHCP server:

sudo /etc/init.d/isc-dhcp-server restart

To set the NFS server#

  1. Install the NFS server on the host using apt-get:

sudo apt-get install nfs-kernel-server nfs-common portmap
  1. Locate and edit the following file:

/etc/exports

Add the corresponding path to the target file system:

${NV_WORKSPACE}/drive- *(async,rw,no_root_squash,no_all_squash,no_subtree_check)

This change exports the target file system.

  1. Restart the NFS server:

 sudo /etc/init.d/nfs-kernel-server restart
sudo exportfs -a

To enable Internet access from the target#

On the Linux host, enter these commands to enable settings on the host:

$ sudo iptables -P FORWARD ACCEPT
$ sudo sysctl -w net.ipv4.ip_forward=1
$ sudo iptables -F
$ sudo iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE

Where eth1 is the interface connected to the network that is connected to the Internet on the host.

$ sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

Where eth0 is the private LAN interface connected to target from the host.

Configuring Static IP to the Device#

The following procedure describes how to assign a static IP to DUT’s 1G or 10G interface for Ubuntu 17.10, 18.04, and higher.

  1. Create the .yaml configuration file for netplan in /etc/netplan if it does not already exist. A number prefix is used for orderly processing. For more information, see man netplan.

Note: Replace eth0 with the interface name of your system.

sudo cat >/etc/netplan/01-network-manager-all.yaml
 network:
         version: 2
         renderer: networkd
         ethernets:
              eth0: # Use your interface name
                  dhcp4: no
                  dhcp6: no
                  addresses:
                            - 10.0.0.X/22   # Your IP address
                  gateway4: 10.0.0.1        # Your gateway
                  nameservers:
                             search: [nvidia.com, client.nvidia.com, nvclient.nvidia.com]  #Your corp domain names
                             addresses: [DNS1,DNS2]
  1. After the editing of the 01-network-manager-all.yaml file is complete, apply the settings using the following command.

sudo netplan apply
  1. Review the configuration.

ip addr
ip show