Windows 10 IoT + Raspberry Pi3B(+) + KMS38 Activation (Server) (UWP-App)

Discussion in 'Windows Embedded' started by JBL2015, Dec 14, 2018.

  1. JBL2015

    JBL2015 MDL Novice

    Mar 20, 2015
    2
    0
    0
    Hi all,

    I am searching for smart and easy solution for a KMS38 Activation (Server) (UWP-App)
    for the Raspberry Pi3B(+) Hardware with Windows 10 IoT Core as a base OS.

    Is there any idea or project (source code) available, to recompile with Visual Studio 2017
    as a UWP-App for the Windows 10 IoT Platform to have a KMS Activation Service for VL.

    Supported Microsoft Products:
    (32-bit and 64-bit)
    Windows Vista/7/8/8.1/10 (v1803) All VL Editions
    Windows Server 2008/2008R2/2012/2012R2/2016/2019 All Editions
    Office 2010 Family on Windows XP SP3 or newer
    Office 2013 Family on Windows 7 or later
    Office 2016 Family on Windows 7 SP1 or later
    Office 2019 Family on Windows 10 or later
    Visual Studio 2013 Ultimate
    Visual Studio 2015 Enterprise
    Visual Studio 2017 Enterprise

    Thanks
    JBL
     
  2. tommy_vercetti

    tommy_vercetti MDL Member

    Apr 3, 2008
    155
    15
    10
    What you are trying to achieve can be done in Rasbian with Vlmscd
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. tommy_vercetti

    tommy_vercetti MDL Member

    Apr 3, 2008
    155
    15
    10
    This file named vlmcsd in /etc/init.d/

    Code:
    #! /bin/sh
    
    ### BEGIN INIT INFO
    # Provides:        vlmcsd
    # Required-Start:    $remote_fs $syslog
    # Required-Stop:    $remote_fs $syslog
    # Default-Start:    2 3 4 5
    # Default-Stop:        0 1 6
    # Short-Description:    KMS server
    ### END INIT INFO
    
    # Author: Hotbird64
    #
    
    # Do NOT "set -e"
    
    if [ `id -u` != 0 ]; then
      echo "Must be root to run this"
      exit 1
    fi
    
    PATH=/usr/local/sbin:/sbin:/usr/sbin:/usr/local/bin:/bin:/usr/bin
    DESC="Microsoft KMS daemon"
    
    NAME=vlmcsd
    DAEMON=/usr/local/sbin/$NAME
    PIDFILE=/var/run/$NAME.pid
    SCRIPTNAME=/etc/init.d/$NAME
    LOGFILE=syslog
    PORT=1688
    
    # Read configuration variable file if it is present
    [ -r /etc/default/$NAME ] && . /etc/default/$NAME
    
    # Exit if the package is not installed
    [ -x "$DAEMON" ] || exit 0
    
    DAEMON_ARGS="-l $LOGFILE -p $PIDFILE -P $PORT"
    
    # Load the VERBOSE setting and other rcS variables
    . /lib/init/vars.sh
    
    # Define LSB log_* functions.
    # Depend on lsb-base (>= 3.2-14) to ensure that this file is present
    # and status_of_proc is working.
    . /lib/lsb/init-functions
    
    #
    # Function that starts the daemon/service
    #
    do_start()
    {
        status="0"
        pidofproc -p $PIDFILE $DAEMON >/dev/null || status="$?"
        
        if [ $status -eq 0 ]; then
            log_action_msg "already running"
            return 3
        fi
    
        $DAEMON $DAEMON_ARGS $EXTRA_ARGS
        return $?
    }
    
    #
    # Function that stops the daemon/service
    #
    do_stop()
    {
            if [ ! -f $PIDFILE ]; then
                    log_action_msg "service not running"
                    return 4
            fi
    
        kill `cat $PIDFILE`
        return $?
    }
    
    case "$1" in
      start)
        log_daemon_msg "Starting $DESC" "$NAME"
        do_start
        case "$?" in
            0) log_end_msg 0 ;;
            *) log_end_msg 1 ;;
        esac
        ;;
      stop)
        log_daemon_msg "Stopping $DESC" "$NAME"
        do_stop
        case "$?" in
            0) log_end_msg 0 ;;
            *) log_end_msg 1 ;;
        esac
        ;;
      restart|force-reload|reload)
        log_daemon_msg "Restarting $DESC" "$NAME"
        do_stop
        sleep 1
        do_start
        case "$?" in
            0) log_end_msg 0 ;;
            *) log_end_msg 1 ;; # Failed to start
        esac
        ;;
      status)
        status_of_proc -p $PIDFILE $DAEMON $NAME && exit 0 || exit $?
        ;;
      *)
        echo "Usage: $SCRIPTNAME {start|stop|status|reload|restart|force-reload}" >&2
        exit 3
        ;;
    esac
    
    and then the vlmcsd binary in /usr/local/sbin/, use
    Code:
    systemctl enable vlmcsd
    to enable at boot and
    Code:
    systemctl start vlmcsd
    to start it
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. JBL2015

    JBL2015 MDL Novice

    Mar 20, 2015
    2
    0
    0
    Hi Tommy,

    thank you for the solution to use the vlmcsd from Hotbird64.

    My problem is now, to use the existing source from vlmcsd and build up a new project with Visual Studio and include the code.

    I am not an expert, but I will train my self with this small project to learn more :)

    From my understanding I need the following steps to build this project for IoT.

    1. Visual Studio 2017 Community
    2. Windows IoT Core Extension for VS Code / the UWP

    1. New Project > Visual C++ > UWP or Background APP with CMD for the LOGs?
    2. Include the source in this new project.
    3. Compile / Debugging?

    Is there any open point or missing here?

    Thanks
    JBL