Zobrazují se příspěvky se štítkemsoftware. Zobrazit všechny příspěvky
Zobrazují se příspěvky se štítkemsoftware. Zobrazit všechny příspěvky

2024-03-07

Remote Desktop client login loop

I was experiencing issue with Remote Desktop app (with orange icon) for accessing AVD workspace. It was working in browser version, it was working on my iPad but I was unable to login from my private Windows PC.


I got into the workspace resources with my username and password in email format but RDP was not initiating and looping in login prompt:

the username and password used to connect to the remote resource didn't work

What I found was the source of problem: I had installed RDS client from Microsoft Store "Windows Store Remote Desktop app" but version from there is not working with AVD and Windows Server 2019. I had to get MSI installer and proceed with that. After that all worked smoothly.

Web client: https://client.wvd.microsoft.com/arm/webclient/

Windows client download: https://learn.microsoft.com/en-us/azure/virtual-desktop/users/connect-windows (get MSI package)  

Other platforms link: https://learn.microsoft.com/en-us/windows-server/remote/remote-desktop-services/clients/remote-desktop-clients

Universal workspace URL: https://rdweb.wvd.microsoft.com/api/arm/feeddiscovery

That's all, I hope it helped :)

2023-04-17

Robot Framework show IP addresses

Recently I was struggling with an error message caused by the not opened firewall between Robot executing computer and the server hosting the website.

"WebDriverException: Message: unknown error: net::ERR_CONNECTION_TIMED_OUT"

So the straightforward solution is to fetch the public and/or private IP address of the machine hosting robot tests to do a proper firewall opening on port 80/443.

You can do it by following block which will print output to the console.

*** Settings ***

Library Selenium2Library

Library String


*** Variables ***

${BROWSER} edge


*** Test Cases ***

Network scanning

[Documentation] Print network details of test execution machine

${ip}= Evaluate [l for l in ([ip for ip in socket.gethostbyname_ex(socket.gethostname())[2] if not ip.startswith("127.")][:1], [[(s.connect(('8.8.8.8', 53)), s.getsockname()[0], s.close()) for s in [socket.socket(socket.AF_INET, socket.SOCK_DGRAM)]][0][1]]) if l][0][0] socket

Log To Console Private IP is: ${ip}

Open Browser http://api.hostip.info/get_json.php ${BROWSER}

${ippublic}= Get Text //html/body/pre #get the IP address text

Log To Console Public networking details are: ${ippublic}

Close Browser

If it's hard to read, use this GitHub Gist with the same code. And that is all what was needed to do.

Here is how the output is looking like:

2022-05-11

Postup přesunutí systémového disku na SSD

Toto jsou poznámky pro mě, až zase budu přidávat do počítače SSD disk namísto HDD (ano stále lze nalézt takové počítače). Klasiký problém je v tom, že původní HDD je kapacitně větší než nové SSD.

Nejjednodušším řešením je nová instalace Windows. Zvládne to i slepice, když nasypete zrní kolem tlačítka enter. Nicméně tento přístup je složitý v případě, že uživatelem počítače je starší osoba, která nemá ráda, když jsou věci jinak než byly.

Klonování disku řeší problém, systém zůstane na chlup stejný, ale všechno se zrychlí. Udělal jsem to po pár neúspěšných pokusech následovně:

  • připravit si instalační Windows USB 
  • vložit nové SSD do počítače
  • odpojit původní disk
  • udělat novou instalaci Windows do prvního restartu (formátování disku a kopírování souborů)
    • zapamatovat si, jak velký byl oddíl na který jsou Windows nainstalovány
  • odpojit nové SSD a připojit původní HDD
  • zapnout "starý počítač" a vše zálohovat
  • uklidit volné místo na disku, přenést velké soubory na externí disk
  • změnšit systémový oddíl (partition s C:\Windows) přes diskmgmt.msc tak, aby byl o chlup menší než oddíl na novém disku
  • připravit Clonezilla live USB klíčenku
  • vypnout počítač a připojit oba dva disky
  • zapnout clonezilla v režimu device-to-device
  • pokračoval volbou partition-to-partition clone
  • zkopírovat ze starého disku (source) oddíl s Windows
  • do nového disku (target) oddíl s Windows
  • vypnout, odpojit starý disk
  • zapnout "nový počítač"
    • buď počítač funguje automaticky, zkontrolovat běžnou funkčnost
    • nebo provést automatickou opravu Windows
  • ověřit, že nový počítač funguje jako ten předchozí
  • vypnout a připojit starý disk
  • po zapnutí namapovat písmena na starý disk, případně přeformátovat
  • vrátit zálohovaná data na původní místo
    • alternativně přemapovat složky dokumentů na starý disk

Pointou je, že nelze použít klonování starého disku na nový, protože se tam nevejde 1:1 (-icds). Proporční změna (-k1) mi udělala spoustu problémů a navíc klonovaný disk není správně bootovatelný. Secure boot není tak snadné obelhat. Při připojení celého klonovaného disku je potřeba změnit ID jednoty přes diskpart. 

Jednoduše zkopírováním pouze oddílu s Windows na místo předchozí instalace není třeba řešit žádné problémy se zavaděčem a skrytými bloky na disku. Stačí si pohlídat celkovou velikost partition.


2022-01-15

Azure vm set tempdb location

It is possible to configure location for temporary databases internally used by SQL server to specified location during server deployment imperatively via Az cli. I realized that not all newly created VMs have that item available in JSON representation even GUI of Azure Portal is reporting some value.

Read query

az vm show --name <VMname> --resource-group <RG> --query resources[0].settings.ServerConfigurationsManagementSettings.SQLStorageUpdateSettingsV2.SQLTempDbSettings.DefaultFilePath -o tsv

Write command

az sql vm update --name <VMname> --resource-group <RG> --set resources[0].settings.ServerConfigurationsManagementSettings.SQLStorageUpdateSettingsV2.SQLTempDbSettings='{"DefaultFilePath":"D:\\SQLTemp"}' -o none

Some more configuration option

  • SQLStorageSettings
    • diskConfigurationType:"NEW"
  • SQLTempDbSettings
    • .defaultFilePath:"<path>"
    • .storageWorkloadType:"OLTP"
  • SQLLogSettings
    • .defaultFilePath
    • .luns
  • SQLDataSettings
    • .defaultFilePath:"F:\\data"
    • .luns

I spotted that some VMs created from the image is not having the option available for reading TempDB location under ServerConfigurationsManagementSettings. It was possible to change basic SQLDataSettings and SQLLogSettings via RDP or SMSS tool but even that configuration didn't propagate to Azure. That happened because pre-prerequisites are not met.

 

Conditions to fulfill: There is an installed VM extension SqlIaasExtension and its state is deployed (visible via Portal). The second crucial condition isis that local user NT service\SQLIaasExtension has granted admin rights within the host. Last but not least the target location where is placed the defaultFilePath must be accessible for read/write/modify for a non-admin account or granted these rights for NT Service\MSSQLSERVER or granted local admin to that user as a whole.

 

It is easy to break SqlIaasExtension agent installation to get stuck in "provisioning" and then "failed" state. I have to discover the solution still to finish this tutorial.


2021-01-10

Azure Classic Select-AzureSubscription Error

No default subscription has been designated. Use Select-AzureSubscription -Default <subscriptionName> to set the default subscription.

Select-AzureSubscription : The subscription id doesn't exist.
Select-AzureSubscription : The subscription name doesn't exist.
Select-AzureSubscription : Parameter set cannot be resolved using the specified named parameters.

Add-AzureAccount : No subscriptions are associated with the logged in account in Azure Service Management (RDFE). This means that the logged in user is not an administrator or co-administrator for any account

Add-AzureAccount : AADSTS50074: Strong Authentication is required.

I had the following problems with Setting the default subscription because of two reasons. For this you need to have set co-administrator rights

Solution: Add classic administrator role inside AAD for user you are using to log in. Azure Portal > subscriptions > subscription - Access control (IAM) > Classic administrators > Add > Add co-administrator and try again!

Non responding Azure VM

It might happen to your virtual machine in Azure Cloud too. It gets stuck without responding to enabled services like SSH, HTTP even pings; in Microsoft words "VM was not responding to any means of communication".

Symptoms: There is no answer from the public IP range as same as from a private network from a machine on the same VNET and subnet. A tricky part is a machine in the portal looks up and running, stopping, and restarting. 

I opened the M$ support case because it was another occasion of the same behavior and I wanted to know the answer. We went through a classic scenario: Restart, deallocation, and redeploy via the portal. The extra task was the restart VM's from the serial console but the serial console did not come up even after a reboot.
Short answer: one of the disks was incorrectly mounted. One of the logs was containing crucial information as "Reached target Emergency Mode" followed by
Failed to mount /var/lib/docker. See 'systemctl status var-lib-docker.mount' for details. Dependency failed for Local File Systems.
That failed mount is preventing VM to boot, it needs to be fixed as described below. We had to create a rescue VM for which we used the OS disk of the impacted VM to create a new VM and it worked.

Solution: add to mount point /etc/fstab an item -nofail. Save and exit. Detach drive and do OS swap for the machine. The reboot should be OK and the machine should be online.

How to rescue the VM
  • Take the snapshot of OS disk - a full snapshot 
    • In disks – Created new disk using source path as a snapshot.
    • Verify the size of the disk and the type of disk used and used the same size and type to create a new disk.
  • Attach the disk to an existing Redhat VM, swap the disk, and mount it.
These few hints might help you to get rid of the troubles.

2021-01-01

Doporučená instalace softwaru a používání služeb

Affiliate sekce, aneb za doporučení výhody pro mě i pro vás.

Počítačové:

Fintech

Služby:

Cestování

2020-08-30

Microsoft kontakty v Android telefonu

V telefonu s operačním systémem Android není nutné používat synchronizaci s účtem Google (i když ten je nezbytné mít také pro správné fungování aktualizací). Nicméně pro uchování kontaktů či položek kalendář je možné použít například služby Microsoft přes některý z jeho účtů (školní, pracovní) a zejména osobní účet. 

Když provedete nastavení intuitivně přes Nastavení => Účty => Přidat účet => Exchange narazíte na hlášku "Pokud chtete použít tento účet vraťte se na přechozí stránku a zvolte 'Outlook, Hotmail a Live', která tam ovšem není.

Takže jak na to? Podobně Nastavení => Účty => Přidat účet => Exchange, kde dole je tlačítko ručně. Zde je nastavení adresy serveru, kam uvedete eas.outlook.com a po kliknutí na další se účet přidá. 





V aplikaci kontakty, pak přes nastavení zvolte a) zobrazení kontaktů ze správného seznamu b) ukládání nových kontaktů do tohoto účtu. U kalendáře mi to fungovalo správně samo.