Praktikum 2: Difference between revisions
No edit summary |
No edit summary |
||
| (40 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
''' |
'''Create bootable Windows PE media''' |
||
Install into the shared folder with your name (shared), created in the previous practical ([[Praktikum_1]]) two programs, ADK.zip and ADKWINPE.zip, which can be found in the public folder of the class or downloaded on your own "[https://go.microsoft.com/fwlink/?linkid=2196127 Windows Assessment and Deployment Kit (ADK) deployment tools]" and "[https://go.microsoft.com/fwlink/?linkid=2196224 ADK Windows PE Add-ons]". Only the Deployment Tools need to be installed in the ADK. |
|||
В поле поиска напишите diskmgmt.msc и запустите Disk Managment |
|||
Выберите в меню Action > Create VHD > Virtual Hard Disk format -> VHD |
|||
Install programs |
|||
Укажите в качестве пути, куда будет сохранен виртуальный диск (Location), общедоступную папку с вашим именем, созданную в предыдущем практикуме ([[Praktikum_1]]) |
|||
Make sure your PC has the ADK and ADK Windows PE add-on installed. |
|||
Размер диска укажите: 1 GB |
|||
Start the Deployment and Imaging Tools Environment as an administrator. |
|||
Щелкните правой кнопкой мыши по заколовку виртуального диска Disk 1 и выберите Initialize Disk |
|||
[[File:Praktikum 2 pilt 1.JPG|400px]] |
|||
Выберите тип разметки диска GPT |
|||
Щелкните правой кнопкой мыши по изображению неразмеченной области (Unallocated) и выберите New Simple Volume (Новый простой том) |
|||
Run ''copype'' to create a working copy of the Windows PE files. |
|||
Выберите файловую систему FAT32, название раздела укажите "WinPE" и поставьте галочку Quick format |
|||
<pre>copype amd64 C:\WinPE_amd64 </pre> |
|||
Убедитесь что диск появился среди других дисков в списке This PC |
|||
Скачайте в общедоступную папку с вашим именем архивный файл "Windows Assessment and Deployment Kit (ADK)" из общего ресурса с образами, распакуйте и установите данный пакет программ в виртуальной ОС Windows (выберите только Windows Preinstallation Enviroment) |
|||
Create a virtual hard drive (.vhd) |
|||
Найдите в списке программ и запустите "Deployment and Imaging Tools Enviroment" |
|||
<pre> |
|||
Запустите команду от имени администратора, которая создает рабочую копию файлов Windows PE: <pre>copype amd64 C:\WinPE_amd64</pre> |
|||
diskpart |
|||
create vdisk file="C:\shared\WinPE.vhd" maximum=1000 |
|||
attach vdisk |
|||
create partition primary |
|||
assign letter=F |
|||
format fs=ntfs quick |
|||
</pre> |
|||
Установите среду предустановки Windows на, созданный ранее виртуальный диск (виртуальную флешку), указав правильную букву диска |
|||
<pre>MakeWinPEMedia /UFD C:\WinPE_amd64 <буква диска>: </pre> |
|||
Prepare the drive by using MakeWinPEMedia: |
|||
Подтвердите решение о перезаписи диска и убедитель, что диск содержит каталоги и файлы |
|||
<pre> |
|||
Корректно отключите диск из ОС (правой кнопкой мыши по иконке диска > eject) и переместите файл (не копируйте) на '''реальный''' ПК в папку с вашей фамилией |
|||
MakeWinPEMedia /UFD C:\WinPE_amd64 F: |
|||
</pre> |
|||
Удалите все файлы и папки (ADK) из общедоступной папки на виртуальной машине |
|||
Detach the drive with diskpart or use Computer Management: |
|||
Завершите работу с Windows Start > Shut Down |
|||
<pre> |
|||
Подсоедините виртуальный диск в программе VirtualBox через меню Settings > Storage > Add New Storage Attachment (иконка с плюсом) > Add New Hard Disk > Choose existing Disk |
|||
diskpart |
|||
select vdisk file="C:\shared\WinPE.vhd" |
|||
detach vdisk |
|||
exit |
|||
</pre> |
|||
Move the resulting WinPE.vhd file (do not copy) to a '''real PC''' in a folder with your lastname |
|||
[[File:Praktikum2_1.JPG]] |
|||
Delete all files and folders (ADK) from the public folder on the virtual machine |
|||
Запустите снова виртуальную машину с Windows и как только появится меню выбора загрузки, нажмите клавишу F12 для выбора дисков |
|||
Shut down with Windows Start > Shut Down |
|||
Выберите диск 2 (Slave) |
|||
Attach the virtual disk in VirtualBox via Settings > Storage > Add New Storage Attachment (icon with a plus) > Add New Hard Disk > Choose existing Disk |
|||
Запуститесь с виртуального диска (флешки) с WinPE |
|||
[[File:Praktikum2_1.JPG|400px]] |
|||
Настройте сеть (если у сетевого интерфейса отсутствует IP адрес), используя команды. |
|||
Start the Windows virtual machine again and when prompted for a password, press and hold the Shift key, then select the Restart button |
|||
<pre> |
|||
netsh interface ip show config |
|||
netsh int ip set address "<Interface>" static <IP adress> <Subnet Mask> |
|||
</pre> |
|||
In the window that appears select "Use a device" and then the last UEFI disk |
|||
Проверьте доступность компьютера-хоста с помощью команды ping |
|||
[[File:Praktikum2_pilt_2.JPG|400px]] |
|||
Наберите команду exit и перезагрузитесь снова в ОС |
|||
Запустите Windows и настройте локальную групповую политику т.о. чтобы была возможность запускать только программу mspaint.exe |
|||
(1. Open 'gpedit', 2. In 'User configuration' select 'Administrative templates', 3. Double click on the 'System', 4. In the window on the right double click 'Run only specified Windows applications', 5. Choose Enable and write "mspaint.exe" in the list of button 'Show') |
|||
Start from the WinPE virtual disk |
|||
Убедитесь, что теперь вы не можете запускать большинство программ (например, cmd). Покажите результат преподавателю! |
|||
When the command prompt appears, type ''exit'' and reboot back into the OS |
|||
Перезагрузитесь снова в среду WinPE и запустите редактор реестра regedit |
|||
Start Windows and configure the local group policy so that you are only able to run the program mspaint.exe |
|||
Выделите ветку реестра HKEY_USERS, выберите из меню File > Load Hive... |
|||
1. Open 'gpedit' |
|||
Найдите из списка тот виртуальный диск на котором установлена Windows и укажите путь к папке администратора (например, E:\Users\user-PC) |
|||
2. In 'User configuration' select 'Administrative templates' |
|||
3. Double click on the 'System' |
|||
4. In the window on the right double click 'Run only specified Windows applications' |
|||
5. Choose Enable and write "mspaint.exe" in the list of button 'Show') |
|||
[[File:Prakikum_2_pilt_3.JPG|400px]] |
|||
Make sure you can't run most programs now (like cmd). Show the result to your teacher! |
|||
Reboot again to the WinPE environment (Shift + restart) |
|||
Run ''diskpart'' and run the commands to assign a letter to the volume with Windows installed |
|||
<pre> |
|||
list disk |
|||
select Disk 0 |
|||
list volume |
|||
select Volume 1 |
|||
assign letter=E |
|||
exit |
|||
</pre> |
|||
[[File:Praktikum2_pilt_4.JPG|400px]] |
|||
В поле ввода имени файла напишите ntuser.dat |
|||
Launch the registry editor ''regedit''. |
|||
Дайте название подключаемой ветке, например user-PC_ntuser.dat |
|||
Highlight the HKEY_USERS registry branch, from the menu select File > Load Hive.... |
|||
Разверните HKEY_USERS и найдите подключаемую ветку с указанным вами названием из предыдущего пункта |
|||
From the list find the virtual disk on which Windows is installed and specify the path to the administrator folder (for example, E:\Users\user) |
|||
Найдите ключ "RestrictRun" в ветке .\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer\ и поменяйте значение с 1 на 0 (или удалите ключ полностью) |
|||
In the file name input field, write ntuser.dat |
|||
Выделите снова подключаемую вами ветку (user-PC_ntuser.dat) и в меню файл выберите Unload Hive... > yes |
|||
[[File:Praktikum_2_pilt_5.JPG|400px]] |
|||
Закройте regedit и запустите команду exit для перезагрузки |
|||
Give a name to the connected branch, for example user_ntuser.dat |
|||
Удостовертесь, что снова можете запускать программы |
|||
Expand HKEY_USERS and find the pluggable branch with the name you specified previously |
|||
Покажите результат преподавателю |
|||
Find the "RestrictRun" key in the .\user_ntuser\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer\ branch and change the value from 1 to 0 |
|||
Select the branch you are connecting again (user_ntuser.dat) and from the File menu choose Unload Hive... > yes |
|||
---- |
|||
Close regedit and run ''exit'' command to reboot |
|||
Make sure you can run programs again |
|||
'''Мне_скучно_сделал_бы_чего_еще''' |
|||
Show the result to the teacher |
|||
Добавьте поддержку в среду WinPE: |
|||
* Русского и эстонского языка [https://technet.microsoft.com/ru-ru/library/cc749248(v=ws.10).aspx] |
|||
[https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/winpe-create-usb-bootable-drive?source=recommendations&view=windows-11 Source] |
|||
Latest revision as of 12:19, 9 September 2025
Create bootable Windows PE media
Install into the shared folder with your name (shared), created in the previous practical (Praktikum_1) two programs, ADK.zip and ADKWINPE.zip, which can be found in the public folder of the class or downloaded on your own "Windows Assessment and Deployment Kit (ADK) deployment tools" and "ADK Windows PE Add-ons". Only the Deployment Tools need to be installed in the ADK.
Install programs
Make sure your PC has the ADK and ADK Windows PE add-on installed.
Start the Deployment and Imaging Tools Environment as an administrator.
Run copype to create a working copy of the Windows PE files.
copype amd64 C:\WinPE_amd64
Create a virtual hard drive (.vhd)
diskpart create vdisk file="C:\shared\WinPE.vhd" maximum=1000 attach vdisk create partition primary assign letter=F format fs=ntfs quick
Prepare the drive by using MakeWinPEMedia:
MakeWinPEMedia /UFD C:\WinPE_amd64 F:
Detach the drive with diskpart or use Computer Management:
diskpart select vdisk file="C:\shared\WinPE.vhd" detach vdisk exit
Move the resulting WinPE.vhd file (do not copy) to a real PC in a folder with your lastname
Delete all files and folders (ADK) from the public folder on the virtual machine
Shut down with Windows Start > Shut Down
Attach the virtual disk in VirtualBox via Settings > Storage > Add New Storage Attachment (icon with a plus) > Add New Hard Disk > Choose existing Disk
Start the Windows virtual machine again and when prompted for a password, press and hold the Shift key, then select the Restart button
In the window that appears select "Use a device" and then the last UEFI disk
Start from the WinPE virtual disk
When the command prompt appears, type exit and reboot back into the OS
Start Windows and configure the local group policy so that you are only able to run the program mspaint.exe
1. Open 'gpedit'
2. In 'User configuration' select 'Administrative templates'
3. Double click on the 'System'
4. In the window on the right double click 'Run only specified Windows applications'
5. Choose Enable and write "mspaint.exe" in the list of button 'Show')
Make sure you can't run most programs now (like cmd). Show the result to your teacher!
Reboot again to the WinPE environment (Shift + restart)
Run diskpart and run the commands to assign a letter to the volume with Windows installed
list disk select Disk 0 list volume select Volume 1 assign letter=E exit
Launch the registry editor regedit.
Highlight the HKEY_USERS registry branch, from the menu select File > Load Hive....
From the list find the virtual disk on which Windows is installed and specify the path to the administrator folder (for example, E:\Users\user)
In the file name input field, write ntuser.dat
Give a name to the connected branch, for example user_ntuser.dat
Expand HKEY_USERS and find the pluggable branch with the name you specified previously
Find the "RestrictRun" key in the .\user_ntuser\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer\ branch and change the value from 1 to 0
Select the branch you are connecting again (user_ntuser.dat) and from the File menu choose Unload Hive... > yes
Close regedit and run exit command to reboot
Make sure you can run programs again
Show the result to the teacher