Tag Archives: remote

Mount Windows Network drives in WSL

In Windows WSL, you can access the local disk navigating the path /mnt/c/ for the C: drive, for example.

Sometimes, network drives mounted on boot aren’t automatically mounted within your WSL Linux shell. You can do it manually using the following commands:

# For a drive already mapped in Windows (e.g. Z: drive)
$ sudo mkdir /mnt/z
$ sudo mount -t drvfs Z: /mnt/z

# For a network drive accessible via \\myserver\dir1 in Explorer
$ sudo mkdir /mnt/dir1
$ sudo mount -t drvfs '\\myserver\dir1' /mnt/dir1

Ubuntu 16.04 GUI remote login

This a script that setup your ubuntu machine with GUI to share the main login screen (like a Windows RDP connection), using x11vnc software.

It installs x11vnc, create a startup service, enable it and reboot the box for you.

    # ##################################################################
    # Script Name : vnc-startup.sh
    # Description : Perform an automated install of X11Vnc
    # Configure it to run at startup of the machine 
    # Date : Feb 2016
    # Written by : Griffon 
    # Web Site :http://www.c-nergy.be - http://www.c-nergy.be/blog
    # Version : 1.0
    #
    # Disclaimer : Script provided AS IS. Use it at your own risk....
    #
    # #################################################################

    # Step 1 - Install X11VNC 
    # ################################################################# 
    sudo apt-get install x11vnc -y

    # Step 2 - Specify Password to be used for VNC Connection 
    # #################################################################

    sudo x11vnc -storepasswd /etc/x11vnc.pass

    # Step 3 - Create the Service Unit File
    # #################################################################

    cat > /lib/systemd/system/x11vnc.service << EOF
    [Unit]
    Description=Start x11vnc at startup.
    After=multi-user.target

    [Service]
    Type=simple
    ExecStart=/usr/bin/x11vnc -auth guess -forever -loop -noxdamage -repeat -rfbauth /etc/x11vnc.pass -rfbport 5900 -shared

    [Install]
    WantedBy=multi-user.target
    EOF

    # Step 4 -Configure the Service 
    # ################################################################

    echo "Configure Services"
    sudo systemctl enable x11vnc.service
    sudo systemctl daemon-reload

    sleep 10

    # Step 5 - Restart System 
    # ################################################################
    sudo shutdown -r now

Source: http://c-nergy.be/blog/?p=8984