프로그램 사용/proxmox2024. 3. 21. 12:30

아니.. 왜 무조건 브릿지로 장치를 만들어줘야 되는거야!?

 

Posted by 구차니
프로그램 사용/proxmox2024. 3. 21. 12:26

어쩌면 당연한데..

장치를 Edit 해서 autostart 해준다고 해서 Active가 되지 않고

Apply Configuration을 해주어야 networking 서비스가 재시작 되면서 Active로 상태가 변경된다.

아니.. 변경하면 자동으로 적용해달라고 ㅠㅠ

 

Posted by 구차니
프로그램 사용/proxmox2024. 3. 21. 12:21

이래서 한글 번역은 안쓰는게 나은가.. -_-

 

벌루닝에 발음이 가까운 듯.

UK/bəˈluː.nɪŋ/ ballooning
US/bəˈluː.nɪŋ/ ballooning

[링크 : https://dictionary.cambridge.org/ko/발음/영어/ballooning]

 

proxmox 에서 설정하는데 고급을 활성화 하니 이상한 옵션이 보인다.

 

영문으로 변경하니 balloon+ing

 

간단하게 요약하면, 가상머신 관리자가

사용하지 않으면 메모리를 회수 할 수 있도록 하는게 벌루닝

그래서 회수되지 않는 최소 메모리가 설정되도록 되는 듯.

[링크 : https://another-section.tistory.com/24]

 

+

libvirt 에서는 아래와 같이 memory(최대 크기) currentMemory(최소 크기, 벌루닝) 로 설정이 되는 듯.

근데 linux kvm 에서 저걸 어디서 써먹더라.. 기억이 안나네.. virsh로 설정하는 것만 어렴풋이 기억이..

Configuration
When setting up a VM two memory sizes can be specified (in libvirt):

<memory unit='GiB'>2</memory>
<currentMemory unit='GiB'>1</currentMemory>
This configures the maximum size to 2 GiB and inflates the balloon leave only 1 GiB.

There are two libvirt commands to change those settings:

virsh setmaxmem --domain $VM --size 3G --config

This updates the maximum memory. Please note that Qemu does not allow changing the size while the VM is running, so you need to shutdown the VM first.

But you can modify the balloon by running the following command:

virsh setmem --domain $VM --size 1500M --current

[링크 : https://pmhahn.github.io/virtio-balloon/]

Posted by 구차니
프로그램 사용/proxmox2024. 3. 21. 12:16

proxmox 에서 cpu 종류를 고르는데 IBRS 라는게 보여서 먼가해서 찾아보니

 

한참 시끄러웠던 cpu 게이트(spector?) 관련 대응 방법으로 보인다.

 

인텔과 AMD는 이런 공격 수법을 완화하고자 하드웨어 기반의 보안 기능을 선보였다. 인텔은 처음 IBRS(간접 분기 추측 제한), 그리고 이후 향상된 분기 예측 제한(elBRS), AMD는 CSV2 완화 조치를 적용했다.

[링크 : https://www.ciokorea.com/news/245028]

 

CPUID 에 지원하는지 뜨는걸 보면.. 마이크로코드 패치가 되어야만 되는건가?

Indirect Branch Restricted Speculation (IBRS) is an indirect branch control mechanism that restricts speculation of indirect branches. A processor supports IBRS if it enumerates CPUID.(EAX=7H,ECX=0):EDX[26] as 1.

[링크 : https://www.intel.com/content/www/us/en/developer/articles/technical/software-security-guidance/technical-documentation/indirect-branch-restricted-speculation.html]

Posted by 구차니
프로그램 사용/proxmox2024. 3. 21. 11:49

LVM 으로 추가하고

 

VM을 생성할 때 스토리지를 정해주면 되는 듯?

 

iso는

폴더보기해서 로컬로 복사해서 올려주면 되나?

 

VM 에서 iso로 연결해주면 일단 어떻게 될 듯.

 

noVNC로 원격 화면을 웹에서 다 보여주는 좋은 세상이구만

Posted by 구차니
프로그램 사용/proxmox2024. 3. 21. 11:30

아무생각없이 설치했더니(기본값)

192.168.100.2/24 로 설정되어서 회사 네트워크와 안 맞아서 접속을 할 수 없는 상황 발생 -_-

그래서 콘솔에서 로그인하여 네트워크 설정 변경

# vi /etc/network/interfaces
# system networking restart

[링크 : https://m.blog.naver.com/17beans/221368885179]

 

어라.. 80포트가 아니었...네?

https://192.168.100.2:8006/

[링크 : https://nad4.tistory.com/entry/Proxmox-설치-및-초기-필수-설정]

 

이제.. 1TB 스토리지에 어떻게 가상 머신들을 넣게 하면 되려나...

Posted by 구차니
프로그램 사용/Blender2024. 3. 20. 19:08

가상머신으로 한번 렌더팜을 만들어 봐야지

 

[링크 : https://github.com/LogicReinc/LogicReinc.BlendFarm]

[링크 : https://gist.github.com/zocker-160/0688a4902421158b66f52dff3966058a]

 

'프로그램 사용 > Blender' 카테고리의 다른 글

blender 수치로 변경  (0) 2024.07.31
blender cad  (0) 2024.05.07
BGE / UPBGE(Blender game engine)  (0) 2023.10.20
blender on macos  (0) 2022.05.24
big bunny blender project file  (0) 2022.05.22
Posted by 구차니
프로그램 사용/uinput2024. 3. 13. 14:49

실제 장치에서 터치 한번 하는걸 흉내냈는데 안되서, 프로토콜 대로 구현하니 된다.

 

linux 5.10.72 이긴 한데 그거 영향인진 모르겠지만

Protocol A 로 구현하니 커서나 클릭도 안되는 것 같고

Protocol B를 따라 구현하니 된다.

 

3.4. Protocol Example B
Here is what a minimal event sequence for a two-contact touch would look like for a type B device:

ABS_MT_SLOT 0
ABS_MT_TRACKING_ID 45
ABS_MT_POSITION_X x[0]
ABS_MT_POSITION_Y y[0]
ABS_MT_SLOT 1
ABS_MT_TRACKING_ID 46
ABS_MT_POSITION_X x[1]
ABS_MT_POSITION_Y y[1]
SYN_REPORT
Here is the sequence after moving contact 45 in the x direction:

ABS_MT_SLOT 0
ABS_MT_POSITION_X x[0]
SYN_REPORT
Here is the sequence after lifting the contact in slot 0:

ABS_MT_TRACKING_ID -1
SYN_REPORT

[링크 : https://docs.kernel.org/input/multi-touch-protocol.html]

 

 

초기화

    struct uinput_setup usetup;
    int keys[] = {BTN_TOUCH}; // BTN_LEFT, BTN_RIGHT, 

    fd_touch = open("/dev/uinput", O_WRONLY | O_NONBLOCK);
    ioctl(fd_touch, UI_SET_EVBIT, EV_KEY);
    for(int i = 0; i < sizeof(keys) / sizeof(int); i++){
        ioctl(fd_touch, UI_SET_KEYBIT, keys[i]);
    }

    //Mouse Pointer events init
    ret = ioctl(fd_touch, UI_SET_EVBIT, EV_ABS);
    ret = ioctl(fd_touch, UI_SET_ABSBIT, ABS_MT_SLOT);
    ret = ioctl(fd_touch, UI_SET_ABSBIT, ABS_MT_POSITION_X);
    ret = ioctl(fd_touch, UI_SET_ABSBIT, ABS_MT_POSITION_Y);
    ret = ioctl(fd_touch, UI_SET_EVBIT, EV_SYN);

    struct uinput_abs_setup abs_setup_x;
    struct uinput_abs_setup abs_setup_y;
    memset(&abs_setup_x, 0, sizeof(abs_setup_x));
    memset(&abs_setup_y, 0, sizeof(abs_setup_y));
    abs_setup_x.code = ABS_MT_POSITION_X;
    abs_setup_x.absinfo.minimum = 0;
    abs_setup_x.absinfo.maximum = 1024;
    abs_setup_y.code = ABS_MT_POSITION_Y;
    abs_setup_y.absinfo.minimum = 0;
    abs_setup_y.absinfo.maximum = 768;
    ret = ioctl(fd_touch, UI_ABS_SETUP, &abs_setup_x);
    ret = ioctl(fd_touch, UI_ABS_SETUP, &abs_setup_y);

    memset(&usetup, 0, sizeof(usetup));
    usetup.id.bustype = BUS_USB;
    usetup.id.vendor = 0x4711;
    usetup.id.product = 0x0817;
    strcpy(usetup.name, "virtual touch device");
    ret = ioctl(fd_touch, UI_DEV_SETUP, &usetup);
    ret = ioctl(fd_touch, UI_DEV_CREATE);

 

터치(클릭) 처리

switch(buttonMask)
{
    default:
        printf("buttonMask[%02X]\n",buttonMask);
    break;
    
    case BUTTON_RELEASE:
        switch(prev_click)
        {
            case BUTTON_L_DOWN:
                printf("BUTTON_L_DOWN BUTTON_RELEASE\n");
                prev_click = -1;
                emit(fd_touch, EV_ABS, ABS_MT_TRACKING_ID, -1);
                emit(fd_touch, EV_SYN, SYN_REPORT, 0);
                break;
        }
        break;

    case BUTTON_L_DOWN:
        if(prev_click == -1)
        {
            printf("BUTTON_L_DOWN\n");
            prev_click = buttonMask;
            emit(fd_touch, EV_ABS, ABS_MT_SLOT, 0);
            emit(fd_touch, EV_ABS, ABS_MT_TRACKING_ID, track_id++);
            emit(fd_touch, EV_ABS, ABS_MT_POSITION_X, pos_x);
            emit(fd_touch, EV_ABS, ABS_MT_POSITION_Y, pos_y);
            emit(fd_touch, EV_ABS, ABS_X, pos_x);
            emit(fd_touch, EV_ABS, ABS_Y, pos_y);
            emit(fd_touch, EV_SYN, SYN_REPORT, 0);
        }
        else
        {
            printf("BUTTON_L_DOWN MOVE\n");
            emit(fd_touch, EV_ABS, ABS_MT_SLOT, 0);
            emit(fd_touch, EV_ABS, ABS_MT_POSITION_X, pos_x);
            emit(fd_touch, EV_ABS, ABS_MT_POSITION_Y, pos_y);
            emit(fd_touch, EV_ABS, ABS_X, pos_x);
            emit(fd_touch, EV_ABS, ABS_Y, pos_y);
            emit(fd_touch, EV_SYN, SYN_REPORT, 0);
        }
        break;
}

 

Posted by 구차니
프로그램 사용/uinput2024. 3. 12. 18:17

대충 봐선(?)

protocol A에 ABS_X, ABS_Y를 추가한 변종(?) 같긴한데

 

아래는 한번 터치해서 클릭하는 내용

BTN_TOUCH로 눌렸다 떼었다 라는 걸 보내주는데

깔끔(?) 하게 원격으로 좌표 + 떼어라 만 보내도 되는지 테스트 해봐야 할 듯 (눌렀다 없이 떼었다가 될지 모르겠음)

 

그 와중에 ABS_MT_TRACKING_ID는 왜 음수 값이 나오지?

 

세번의 터치가 있었는데(터치 1회, 드래그, 줌 인)

그 때 마다 ABS_MT_TRACKING_ID가 증가하고 매번 -1 로 BTN_TOUCH 0 을 누르기 전에 트래킹이

사용되지 않는다는걸 알려주는건가..?

마지막의 Tracking_id 2,3은 두 손가락으로 줌 인 한 거라, 각각의 손가락에 대해서 처리하는 듯

 

A non-negative tracking id is interpreted as a contact, and the value -1 denotes an unused slot

[링크 : https://www.kernel.org/doc/Documentation/input/multi-touch-protocol.txt]

Posted by 구차니
프로그램 사용/uinput2024. 3. 12. 11:03

아래와 같이 설정하면 BTN_LEFT, BTN_RIGHT 때문에, udev에서 Mouse Touchscreen으로 인식된다.

    int keys[] = {BTN_LEFT, BTN_RIGHT, BTN_TOUCH};

    fd = open("/dev/uinput", O_WRONLY | O_NONBLOCK);

    //Custom key events init
    ioctl(fd, UI_SET_EVBIT, EV_KEY);
    for(int i = 0; i < sizeof(keys) / sizeof(int); i++){
        ioctl(fd, UI_SET_KEYBIT, keys[i]);
    }
[01:49:49.721] event5  - virtual touch driver: is tagged by udev as: Mouse Touchscreen
[01:49:49.722] event5  - virtual touch driver: kernel bug: device has min == max on ABS_MT_POSITION_X
[01:49:49.722] event5  - virtual touch driver: was rejected
[01:49:49.722] event5  - using input device '/dev/input/event5'

 

그래서 BTN_TOUCH만 넣으면 Mouse는 빠지고 Touchscreen만 뜨는데, 도대체 커널 버그 쪽은 어떻게 해결해야 할까?

    int keys[] = {BTN_TOUCH}; // BTN_LEFT, BTN_RIGHT

    fd = open("/dev/uinput", O_WRONLY | O_NONBLOCK);

    //Custom key events init
    ioctl(fd, UI_SET_EVBIT, EV_KEY);
    for(int i = 0; i < sizeof(keys) / sizeof(int); i++){
        ioctl(fd, UI_SET_KEYBIT, keys[i]);
    }
[01:50:22.720] event5  - virtual touch driver: is tagged by udev as: Touchscreen
[01:50:22.720] event5  - virtual touch driver: kernel bug: device has min == max on ABS_MT_POSITION_X
[01:50:22.720] event5  - virtual touch driver: was rejected
[01:50:22.720] event5  - not using input device '/dev/input/event5'

 

+

chatGPT 응답해준 것을 조합하면 아래와 같이 하면

일단 터치 장비로 인식은 되는데.. 커서도 안되고 터치 이동, 클릭을 어떻게 구현해야 하나...

void initializeTouchEvent(int fd) {
    struct uinput_setup usetup;
    int keys[] = {BTN_TOUCH}; // BTN_LEFT, BTN_RIGHT, 

    fd = open("/dev/uinput", O_WRONLY | O_NONBLOCK);
    ioctl(fd, UI_SET_EVBIT, EV_KEY);

    // 사용할 키 등록(터치니까 BTN_TOUCH 만, BTN_LEFT 나 BTN_RIGHT가 등록되면 마우스로 인식됨)
    for(int i = 0; i < sizeof(keys) / sizeof(int); i++){
       ioctl(fd, UI_SET_KEYBIT, keys[i]);
    }

    ioctl(fd, UI_SET_EVBIT, EV_ABS);
    ioctl(fd, UI_SET_ABSBIT, ABS_MT_SLOT);
    ioctl(fd, UI_SET_ABSBIT, ABS_MT_POSITION_X);
    ioctl(fd, UI_SET_ABSBIT, ABS_MT_POSITION_Y);
    ioctl(fd, UI_SET_ABSBIT, ABS_MT_TRACKING_ID);  // 요건 없어도 되는 듯
    ioctl(fd, UI_SET_EVBIT, EV_SYN);

    struct uinput_abs_setup abs_setup_x;
    struct uinput_abs_setup abs_setup_y;
    memset(&abs_setup_x, 0, sizeof(abs_setup_x));
    memset(&abs_setup_y, 0, sizeof(abs_setup_y));
    abs_setup_x.code = ABS_MT_POSITION_X;
    abs_setup_x.absinfo.minimum = 0; // 최솟값
    abs_setup_x.absinfo.maximum = 1024; // 최댓값
    abs_setup_y.code = ABS_MT_POSITION_Y;
    abs_setup_y.absinfo.minimum = 0; // 최솟값
    abs_setup_y.absinfo.maximum = 1024; // 최댓값

    ioctl(fd, UI_SET_ABSBIT, ABS_MT_POSITION_X);
    ioctl(fd, UI_SET_ABSBIT, ABS_MT_POSITION_Y);
    ioctl(fd, UI_ABS_SETUP, &abs_setup_x);
    ioctl(fd, UI_ABS_SETUP, &abs_setup_y);

    // 가상 디바이스를 생성
    memset(&usetup, 0, sizeof(usetup));
    usetup.id.bustype = BUS_USB;
    usetup.id.vendor = 0x1;
    usetup.id.product = 0x1;
    strcpy(usetup.name, "Virtual Touch Device");

    ioctl(fd, UI_DEV_SETUP, &usetup);
    ioctl(fd, UI_DEV_CREATE);
}
Posted by 구차니