Windows 10 to Ubuntu 22.04 LTS Fails with 'The token supplied to the function is invalid'

Bug #1970924 reported by Ross
38
This bug affects 6 people
Affects Status Importance Assigned to Milestone
Ubuntu
Confirmed
Undecided
Unassigned

Bug Description

When attempting to use remote desktop from a Windows 10 (21H2 19044.1566) box to an Ubuntu 22.04 LTS (fully patched), I receive the following error:

An authentication error has occurred.
The token supplied to the function is invalid.

Remote computer: {Computer name}

This is when attempting to RDP with an AD domain user, which I can confirm logs in successfully locally.

Tags: bot-comment
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. It seems that your bug report is not filed about a specific source package though, rather it is just filed against Ubuntu in general. It is important that bug reports be filed about source packages so that people interested in the package can find the bugs about it. You can find some hints about determining what package your bug might be about at https://wiki.ubuntu.com/Bugs/FindRightPackage. You might also ask for help in the #ubuntu-bugs irc channel on Libera.chat.

To change the source package that this bug is filed about visit https://bugs.launchpad.net/ubuntu/+bug/1970924/+editstatus and add the package name in the text box next to the word Package.

[This is an automated message. I apologize if it reached you inappropriately; please just reply to this message indicating so.]

tags: added: bot-comment
Ross (rossbuntu)
description: updated
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in ubuntu:
status: New → Confirmed
Revision history for this message
Rustam Aliev (rustam-python) wrote (last edit ):

Confirmed. The same Windows version, the same Ubuntu version, the same bug.

RDP is working with xrdp package.

It almost mounth passed... Will there be any solution?

Revision history for this message
Jarom West (jaromwest) wrote :

I just performed a fresh install of Ubuntu 22.04 and was trying to RDP into it from a Windows 10 machine, and was running into the same problem described in this thread.

For me, the solution was to append the username when running the RDP client. I was also getting the error "The token supplied to the function is invalid." originally when trying to remote in.

Instead of:
username: jwest
password: <mypass>

I used:
username: .\jwest
password: <mypass>

In a Windows environment, if you don't prepend the username with ".\" it will try to login to the target computer using a local user account specified, instead of a Domain account for example. Not sure if this solution works for you, but it worked for me. (So I created a LaunchPad account to post this.) Cheers.

Revision history for this message
Rustam Aliev (rustam-python) wrote (last edit ):

I tried with Jarom West's solution (https://bugs.launchpad.net/ubuntu/+bug/1970924/comments/5) on 22.04.1 – it's still not working for me (I also created a LaunchPad account just to report this bug). Please fix it.

Revision history for this message
Paul Abi Nasr (paulabinasr) wrote :

Did you change the password in the settings section , under the remote desktop ?
it happens that the password is simply not the same as the user's password in ubuntu. The system generates a new one for you.

once i figured that out, it worked like a charm

(clearly the error should have been 'wrong password', instead of what we are getting)

Revision history for this message
Corneliu Galev (cgalev) wrote :

Paul is right. The error message 'The token supplied to the function is invalid' should say 'wrong password' or 'invalid credentials'.

Anyway I am passed this credential error but now I am stuck at another error:
'Because of a protocol error, this session will be disconnected'

Revision history for this message
brian.wintle (boobooboon) wrote :

Yes i have the same problem but im running ubuntu 22.04 along side windows 10

Revision history for this message
Akos (falconium) wrote :

I also have the same issue.
Paul Abi Nasr (paulabinasr) wrote on 2022-09-06 is right. Once I made it working after I turned off the auto login feature of Ubuntu. The problem with it is that the keyring is not accessible yet at the time when the Sharing functionality starts, so it generates a new password for remote connection.
I changed to manual login, then it worked for a while, but now again it gives me the same stuff.

Revision history for this message
Chris Smalley (cruj0nes) wrote :

I was positive I was hitting this bug with ya'll , because I had most of the strange behavior mentioned from Windows 11 to Ubuntu like the token error *but* make sure you TRIPLE check your username and password defined in the Remote Desktop portion of Ubuntu.

..I am an Ubuntu noob so I ended up rebuilding my instance for another reason, but got frustrated trying to get RDP to work. Teamviewer also sucks, but alas.

Cheers.

Revision history for this message
Joe Smith (joesmith32158976) wrote :

Hello,

Confirm this mislabelled error is still an issue

Just got token supplised to the function is invalid in windows 10 22h2

trying to connect to network local machine cnc.lan with login cnc passowrd cnc

Might be necessary to "set" the password because the default doesn't seem to apply
in sharing -> remote desktop -> authentification -> password

Note this is running /usr/libexec/gnome-remote-desktop-daemon

It worked fine, then I rebooted and now it says

https://i.imgur.com/8aEgNyw.png

"An internal error has occurred"

Not too useful there microsoft remote desktop

in /var/log/syslog I can now see

Jul 16 04:46:48 cnc gnome-remote-de[816]: [RDP] Username is not set, denying client

even though I've set the user cnc

Told rdp client to edit config setting, even though it is set

https://i.imgur.com/klgsyBX.png

Following on to https://askubuntu.com/questions/1470629/ubuntu-22-04-gnome-remote-desktop-windows-rdp-username-not-set-denying-client

I went back to sharing -> remote desktop -> authentification -> username and password

I set again both of them and I could immediately connect remotely via RDP

You can see here the remote desktop page doesn't fit in screen, but you don't need to press anything lower, there is no save button, the changes take effect immediately https://i.imgur.com/RKlofhB.png

Now I reboot again ....

(computer appears to hang after reboot, possibly an update going bad at the same time ? Will let it run overnight to see if it completes without a forced shutdown)

Revision history for this message
Matti Shubeli (mattishubeli) wrote :

I had the same error message. The solution might not be as easy for you guys, as it was for me :) I noticed that I forgot to set the username in RD.

Make sure you have the same username that you have on the server side.

Revision history for this message
Joe Smith (joesmith32158976) wrote :
Download full text (3.7 KiB)

Later that night...

I went back to the computer and it still had not booted. I had to force shut it down.

Once it had booted, I tried connecting and ...

https://i.imgur.com/4norRln.png

Got the same error "An internal error has occurred" on the ms client side

server side

gnome-remote-de[822]: [RDP] Username is not set, denying client

This computer is a fresh install of 22.04.2 ubuntu

basic automatic filesystem setup on UEFI system
dark mode enabled
automatic login
disable auto lock
system updated and upgraded
these packages installed qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools libqt5serialport5-dev qtcreator build-essential git

Next I will try to do, just a reboot. See if it reboots without issue normally.

Ah it always hangs during restarts now.

Might be due to the earlier install, or maybe gnome-remote-desktop settings, can't tell.

So I"m going to re-install a fresh copy of ubuntu 22.04.2 and test without updating first

----------

ok Ubuntu re-installed

Ok done

Fressh 22.04.2, no updates, just installed openssh-server, enabled sharing-> remote desktop set the username and password (to cnc in my case)

https://i.imgur.com/4iV9zyv.png

ANd still right away the error

gnome-remote-de[854]: [RDP] Username is not set, denying client

I tried manually setting the credentials with

sudo grdctl set-credentials cnc cnc

but it replies with usage information (though not exactly an error ?!)

Usage: grdctl [OPTIONS...] COMMAND [SUBCOMMAND]...

went back to the rdp server computer, went into sharing -> remote desktop -> typed in the password again and enter

And now finally, the MS RDP client asks "Enter your credentials"

https://i.imgur.com/sscS2cd.png

It says "identify of the remote computer cannot be verified" connect anyway ? - YES

ANd it works and it's connected https://i.imgur.com/1BsAncH.png

Now I just reboot

https://i.imgur.com/tLA3MMS.png

system reboots quickly, it's back to the desktop, I try to connect

https://i.imgur.com/AbVqrVW.png

And the error's back

 I didn't click "remember me" I didn't click "don't ask again" about the certificate

It says in /var/log/syslog gnome-remote-de[856]: [RDP] Username is not set, denying client

It will not connect no matter what ....

I try grdctl again this time I think I have the right command line

sudo grdctl rdp set-credentials cnc cnc

but uh oh Cannot autolaunch D-Bus without X11 $DISPLAY

 I guess I need to set the DISPLAY variable

cnc@cnc:~$ sudo grdctl rdp set-credentials cnc cnc
Cannot autolaunch D-Bus without X11 $DISPLAY
cnc@cnc:~$ export DISPLAY=:0
cnc@cnc:~$ sudo grdctl rdp set-credentials cnc cnc
Failed to execute child process ?dbus-launch? (No such file or directory)

Ok, I'll go type this in the console of the desktop of the server

Well same error

https://i.imgur.com/UAWYArw.jpg

I think there well and truly is a bug there !?

The rdp server is losing it's login and password on every reboot and you can set them automatically with a command line automation

set the password in sharing -> remote desktop again

and it just works immediately https://i.imgur.com/TbdKnS4.png

didn't even need to press enter

I disconnect

remote desktop c...

Read more...

Revision history for this message
Garrett Mitchener (garrett-mitchener) wrote :
Revision history for this message
Raffaele Rialdi (raffaeler) wrote :

Still hitting this on Ubuntu 23.10

Revision history for this message
Chith Lonn (intensityshai) wrote :

I'm a first time user and just installed Ubuntu.
I had the same error message when I was trying to RDP from my Windows 10 PC.
I got mine to work, apparently the username was case sensitive.

Revision history for this message
Raffaele Rialdi (raffaeler) wrote :

I'll give more details: I see the same behavior described by Joe Smith.
After rebooting, I have to change the password in the share dialog. Once I do that, I can successfully gain control using RDP, otherwise I see the error described in this thread.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.