FastNetMon

Saturday 2 March 2024

How to create bootable USB for Windows 2022 server on Ubuntu 22.04

NB! Sadly this guide below did not work on my system (apparently because it's not very recent system) and I decided to use WoeUSB instead. 

It's very easy to use:

sudo ./woeusb-5.2.4.bash --device ~/Documents/Window/SERVER_EVAL_x64FRE_en-us.iso /dev/sdX

Please note that it will overwrite all data on USB stick.

Example output:

WoeUSB v5.2.4

==============================

Info: Mounting source filesystem...

Info: Wiping all existing partition table and filesystem signatures in /dev/sda...

/dev/sda: 8 bytes were erased at offset 0x00000200 (gpt): 45 46 49 20 50 41 52 54

/dev/sda: 8 bytes were erased at offset 0x729bffe00 (gpt): 45 46 49 20 50 41 52 54

/dev/sda: 2 bytes were erased at offset 0x000001fe (PMBR): 55 aa

/dev/sda: calling ioctl to re-read partition table: Success

Info: Ensure that /dev/sda is really wiped...

Info: Creating new partition table on /dev/sda...

Info: Creating target partition...

Info: Making system realize that partition table has changed...

Info: Wait 3 seconds for block device nodes to populate...

mkfs.fat 4.2 (2021-01-31)

mkfs.fat: Warning: lowercase labels might not work properly on some systems

Info: Mounting target filesystem...

Info: Copying files from source media...

Splitting WIM: 4127 MiB of 4127 MiB (100%) written, part 2 of 24%

Finished splitting "./sources/install.wim"

Info: Installing GRUB bootloader for legacy PC booting support...

Installing for i386-pc platform.

 


Installation finished. No error reported.

Info: Installing custom GRUB config for legacy PC booting...

Info: Done :)

Info: The target device should be bootable now

Info: Unmounting and removing "/tmp/woeusb-source-20240302-155025-Saturday.g0vizR"...

Info: Unmounting and removing "/tmp/woeusb-target-20240302-155025-Saturday.T2VU0b"...

Info: You may now safely detach the target device


As first step format USB stick by creating new GPT partition table on it:


Then create single partition on it using NTFS file system:


Then review changes:

After that you will see that this partition will be mounted in file manager:


After that download ISO image for Wndows 2022 server from official web site and click twice on downloaded ISO and it will be mounted too:

Then select all files from mounted ISO disk to mounted NTFS partition on USB disk:


Wait until finish and unmount it using unmount button on left side:
Please be patient as unmount will take significant time:


Done!








Sunday 21 January 2024

jTAG / UART / serial console access for ROCKPro64 with CH340 UART USB

I bought ROCKPro64 quite long time ago and it's still pretty good even in 2024. So I decided to install official Debian for it to use it for NAT64 gateway and home automation platform. 

To install Debian I need console access as HDMI does not work until you install Linux Distro which supports it.

So I decided to play with serial port access. On SBC you need to plug 3 pins to Pi-2-bus with following order.


On CH340 you need to plug them in following order:


And yellow jumper need to be in 3V3 mode this way:



Then you need to plug CH341 to your PC and check that it recognised correctly in dmesg:

[ 6981.858478] usb 1-5: new full-speed USB device number 23 using xhci_hcd

[ 6982.107488] usb 1-5: New USB device found, idVendor=1a86, idProduct=7523, bcdDevice= 2.64

[ 6982.107492] usb 1-5: New USB device strings: Mfr=0, Product=2, SerialNumber=0

[ 6982.107494] usb 1-5: Product: USB Serial

[ 6982.120247] ch341 1-5:1.0: ch341-uart converter detected

[ 6982.134269] usb 1-5: ch341-uart converter now attached to ttyUSB0

It may not connect from first attempt but you can try it multiple times to get required results.  

After that you can run screen or minicom on your Linux box:

screen /dev/ttyUSB0 1500000

And finally reboot SBC using power (keep it for 5+ seconds) or reset button and then you will see boot sequence:

Hit any key to stop autoboot: 1 

switch to partitions #0, OK

Scanningmmc1:1... 

Retrieving file: /extlinux/extlinux.conf


Enter choice: 1:        Debian-Installer

Retrieving file: /initrd.gz

Retrieving file: /dtbs/rockchip/rk3399-rockpro64.dtb

Moving Image from 0x2080000 to 0x2200000, end=4050000

 01f00000

   Booting using the fdt blob at   Loading Ramdisk to ef112000, OK

   Loading Device Tree to 00000000ef0ff000, end 00000000ef111300OK


Starting kernel ...


My guide was based on this reference guide. 

In some cases device may refuse loading when TXD cable is plugged and you will need temporarily unplug it.